From 599b6aab677439ae1bdea2cdca3233d0b763fd3f Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 17 Oct 2016 23:09:21 +0200 Subject: Updated just about all of the pages to the template-based redesign. Added ajaxified loading for feature pages. --- .../templates/features/experimental/Helper.html | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 website2/templates/features/experimental/Helper.html (limited to 'website2/templates/features/experimental/Helper.html') diff --git a/website2/templates/features/experimental/Helper.html b/website2/templates/features/experimental/Helper.html new file mode 100644 index 00000000..93b6e2b4 --- /dev/null +++ b/website2/templates/features/experimental/Helper.html @@ -0,0 +1,52 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@Helper" logline="With a little help from my friends... Helper methods for java."> + <@f.history> +

+ @Helper was introduced as an experimental feature in lombok v1.16.6. +

+ + + <@f.experimental> + + Current status: unknown - We don't have enough experience with this feature to make predictions on its future. + + + <@f.overview> +

+ 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 @Helper comes in and helps you out! Annotate a method local class with @Helper 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. +

+ Normally you'd have to declare an instance of your helper, for example: HelperClass h = new HelperClass(); directly after declaring your helper class, and then call methods in your helper class with h.helperMethod();. With @Helper, 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 nameOfHelperInstance. +

+ + + <@f.snippets name="experimental/Helper" /> + + <@f.confKeys> +
+ lombok.helper.flagUsage = [warning | error] (default: not set) +
+ Lombok will flag any usage of @Helper as a warning or error if configured. +
+ + + <@f.smallPrint> +

+ @Helper requires that the helper class has a no-args constructor. A compiler error will be generated if this is not the case. +

+ Currently, the instance of your helper that's made under the hood is called $Foo, where Foo 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. +

+ Please don't rely on this making any sense in the helper method code. You can refer to the real 'this' by using the syntax NameOfMyClass.this. +

+ ANY unqualified method call in code that exists below 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. +

+ Unless you're using JDK8 or higher (which introduced the concept of 'effectively final'), you'll have to declare local variables and parameters as final if you wish to refer to them in your method local class. This is a java limitation, not something specific to lombok's @Helper. +

+ + -- cgit