mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-28 20:21:01 +00:00
69 lines
4.3 KiB
HTML
69 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<link rel="stylesheet" type="text/css" href="../logi/reset.css" />
|
|
<link rel="stylesheet" type="text/css" href="features.css" />
|
|
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
|
|
<meta name="description" content="Spice up your java" />
|
|
<title>Lombok feature overview</title>
|
|
</head><body><div id="pepper">
|
|
<div class="minimumHeight"></div>
|
|
<div class="meat">
|
|
<div class="header"><a href="../index.html">Project Lombok</a></div>
|
|
<h1>Lombok features</h1>
|
|
<div class="index overview">
|
|
<dl>
|
|
<dt><a href="GetterSetter.html"><code>@Getter</code> / <code>@Setter</code></a></dt>
|
|
<dd>Never write <code>public int getFoo() {return foo;}</code> again.</dd>
|
|
<dt><a href="ToString.html"><code>@ToString</code></a></dt>
|
|
<dd>No need to start a debugger to see your fields: Just let lombok generate a <code>toString</code> for you!</dd>
|
|
<dt><a href="EqualsAndHashCode.html"><code>@EqualsAndHashCode</code></a></dt>
|
|
<dd>Equality made easy: Generates <code>hashCode</code> and <code>equals</code> implementations from the fields of your object.</dd>
|
|
<dt><a href="Data.html"><code>@Data</code></a></dt>
|
|
<dd>All together now: A shortcut for <code>@ToString</code>, <code>@EqualsAndHashCode</code>,
|
|
<code>@Getter</code> on all fields, and <code>@Setter</code> on all non-final fields. You even
|
|
get a free constructor to initialize your final fields!</dd>
|
|
<dt><a href="Cleanup.html"><code>@Cleanup</code></a></dt>
|
|
<dd>Automatic resource management: Call your <code>close()</code> methods safely with no hassle.</dd>
|
|
<dt><a href="Synchronized.html"><code>@Synchronized</code></a></dt>
|
|
<dd><code>synchronized</code> done right: Don't expose your locks.</dd>
|
|
<dt><a href="SneakyThrows.html"><code>@SneakyThrows</code></a></dt>
|
|
<dd>To boldly throw checked exceptions where no one has thrown them before!</dd>
|
|
</dl>
|
|
</div>
|
|
<div class="pointer">
|
|
The documentation above is a lot easier to follow, but if you want to build your own transformations,
|
|
or you want to add javadoc to <code>lombok.jar</code> in your IDE, you can also check out <a href="../api/index.html">the javadoc</a>.
|
|
</div>
|
|
<h1>Running Lombok</h1>
|
|
<h3>On eclipse</h3>
|
|
Execute lombok.jar (doubleclick it, or run java -jar lombok.jar). Follow instructions.
|
|
<h3>On javac (and maven, ant, and other build tools)</h3>
|
|
Include lombok.jar on the classpath as you compile. That's all there is to it!<br />
|
|
Lombok hosts its own maven repository, so adding lombok to maven is very simple. <a href="/mavenrepo/index.html">full instructions are here</a>.
|
|
<h3>On GWT (Google Widget Toolkit), javadoc, and other source-based tools</h3>
|
|
Use <a href="delombok.html">delombok</a> first, then run javadoc or GWT on the delombok-ed code.
|
|
<h1>Running delombok</h1>
|
|
<div>Delombok copies your source files to another directory, replacing all lombok annotations with their desugared form. So, it'll turn <code>@Getter</code>
|
|
back into the actual getter. It then removes the annotation. This is useful for all sorts of reasons; you can check out what's happening under the hood,
|
|
if the unthinkable happens and you want to stop using lombok, you can easily remove all traces of it in your source, and you can use delombok to preprocess
|
|
your source files for source-level tools such as javadoc and GWT. More information about how to run delombok, including instructions for build tools
|
|
can be found at the <a href="delombok.html">delombok page</a>.</div>
|
|
<div class="footer">
|
|
<a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009 Reinier Zwitserloot and Roel Spilker, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span>
|
|
</div>
|
|
<div style="clear: both;"></div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
|
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
|
</script>
|
|
<script type="text/javascript">
|
|
try {
|
|
var pageTracker = _gat._getTracker("UA-9884254-1");
|
|
pageTracker._trackPageview();
|
|
} catch(err) {}
|
|
</script>
|
|
</body></html>
|