aboutsummaryrefslogtreecommitdiff
path: root/website/features
diff options
context:
space:
mode:
Diffstat (limited to 'website/features')
-rw-r--r--website/features/experimental/Helper.html83
-rw-r--r--website/features/experimental/UtilityClass.html80
2 files changed, 0 insertions, 163 deletions
diff --git a/website/features/experimental/Helper.html b/website/features/experimental/Helper.html
deleted file mode 100644
index da474fc2..00000000
--- a/website/features/experimental/Helper.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!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>EXPERIMENTAL – @Helper</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>@Helper</h1>
- <div class="byline">With a little help from my friends... Helper methods for java.</div>
- <div class="since">
- <h3>Since</h3>
- <p>
- <code>@Helper</code> was introduced as an experimental feature in lombok v1.16.6.
- </p>
- </div>
- <div class="experimental">
- <h3>Experimental</h3>
- <p>
- Experimental because:
- <ul>
- <li>Lambdas with general function types offer an alternative strategy.</li>
- <li>Perhaps a way to make helper methods with less boilerplate is possible, making this feature obsolete.</li>
- </ul>
- Current status: <em>unknown</em> - We don't have enough experience with this feature to make predictions on its future.
- </div>
- <div class="overview">
- <h3>Overview</h3>
- <p>
- This annotation lets you put methods in methods. You might not know this, but you can declare classes inside methods, and the methods in this class can access any (effectively) final local variable or parameter defined and set before the declaration. Unfortunately, to actually call any methods you'd have to make an instance of this method local class first, but that's where <code>@Helper</code> comes in and helps you out! Annotate a method local class with <code>@Helper</code> and it's as if all the methods in that helper class are methods that you can call directly, just as if java had allowed methods to exist inside methods.
- </p><p>
- Normally you'd have to declare an instance of your helper, for example: <code>HelperClass h = new HelperClass();</code> directly after declaring your helper class, and then call methods in your helper class with <code>h.helperMethod();</code>. With <code>@Helper</code>, both of these things are no longer needed: You do not need to waste a line of code declaring an instance of the helper, and you don't need to prefix all your calls to helper methods with <code>nameOfHelperInstance.</code>
- </p>
- </div>
- <div class="snippets">
- <div class="pre">
- <h3>With Lombok</h3>
- <div class="snippet">@HTML_PRE@</div>
- </div>
- <div class="sep"></div>
- <div class="post">
- <h3>Vanilla Java</h3>
- <div class="snippet">@HTML_POST@</div>
- </div>
- </div>
- <div style="clear: left;"></div>
- <div class="overview">
- <h3>Small print</h3><div class="smallprint">
- <p>
- <code>@Helper</code> requires that the helper class has a no-args constructor. A compiler error will be generated if this is not the case.
- </p><p>
- Currently, the instance of your helper that's made under the hood is called <code>$Foo</code>, where <code>Foo</code> is the name of your helper. We might change this in the future; please don't rely on this variable existing. We might even replace this later with a sibling method instead.
- </p><p>
- Please don't rely on <code>this</code> making any sense in the helper method code. You can refer to the real 'this' by using the syntax <code>NameOfMyClass.this</code>.
- </p><p>
- <em>ANY</em> unqualified method call in code that exists <em>below</em> the declaration of the helper method with the same name as any method in the helper is assumed to be a call to the helper. If the arguments don't end up being compatible, you get a compiler error.
- </p><p>
- Unless you're using JDK8 or higher (which introduced the concept of 'effectively final'), you'll have to declare local variables and parameters as <code>final</code> if you wish to refer to them in your method local class. This is a java limitation, not something specific to lombok's <code>@Helper</code>.
- </p>
- </div>
- </div>
- <div class="footer">
- <a href="index.html">Back to experimental features</a> | <a href="UtilityClass.html">Previous feature (@UtilityClass)</a> | <span class="disabled">Next feature</span><br />
- <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright &copy; 2009-2016 The Project Lombok Authors, 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>
diff --git a/website/features/experimental/UtilityClass.html b/website/features/experimental/UtilityClass.html
deleted file mode 100644
index d123b384..00000000
--- a/website/features/experimental/UtilityClass.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!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>EXPERIMENTAL – @UtilityClass</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>@UtilityClass</h1>
- <div class="byline">Utility, metility, wetility! Utility classes for the masses.</div>
- <div class="since">
- <h3>Since</h3>
- <p>
- <code>@UtilityClass</code> was introduced as an experimental feature in lombok v1.16.2.
- </p>
- </div>
- <div class="experimental">
- <h3>Experimental</h3>
- <p>
- Experimental because:
- <ul>
- <li>Some debate as to whether its common enough to count as boilerplate.</li>
- </ul>
- Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon.
- </div>
- <div class="overview">
- <h3>Overview</h3>
- <p>
- A utility class is a class that is just a namespace for functions. No instances of it can exist, and all its members
- are static. For example, <code>java.lang.Math</code> and <code>java.util.Collections</code> are well known utility classes. This annotation automatically turns the annotated class into one.
- </p><p>
- A utility class cannot be instantiated. By marking your class with <code>@UtilityClass</code>, lombok will automatically
- generate a private constructor that throws an exception, flags as error any explicit constructors you add, and marks
- the class <code>final</code>. If the class is an inner class, the class is also marked <code>static</code>.
- </p><p>
- <em>All</em> members of a utility class are automatically marked as <code>static</code>. Even fields and inner classes.
- </p>
- </div>
- <div class="snippets">
- <div class="pre">
- <h3>With Lombok</h3>
- <div class="snippet">@HTML_PRE@</div>
- </div>
- <div class="sep"></div>
- <div class="post">
- <h3>Vanilla Java</h3>
- <div class="snippet">@HTML_POST@</div>
- </div>
- </div>
- <div style="clear: left;"></div>
- <div class="overview">
- <h3>Small print</h3><div class="smallprint">
- <p>
- There isn't currently any way to create non-static members, or to define your own constructor. If you want to instantiate
- the utility class, even only as an internal implementation detail, <code>@UtilityClass</code> cannot be used.
- </p>
- </div>
- </div>
- <div class="footer">
- <a href="index.html">Back to experimental features</a> | <a href="onX.html">Previous feature (onX)</a> | <a href="Helper.html">Next feature (@Helper)</a><br />
- <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright &copy; 2009-2016 The Project Lombok Authors, 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>