From 84d017e27047042c2299110fe08302840c45320d Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 17 Jul 2009 18:07:43 +0200 Subject: Features are now 'compiled' by the build.xml script to include the snippets, found in the usage_examples directory. Also worked on the styling of the feature pages. --- website/features/GetterSetter.html | 36 ++++++++++++++++++++++++++++++-- website/features/features.css | 42 +++++++++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 5 deletions(-) (limited to 'website') diff --git a/website/features/GetterSetter.html b/website/features/GetterSetter.html index 246a8eab..d8ffbb6a 100644 --- a/website/features/GetterSetter.html +++ b/website/features/GetterSetter.html @@ -1,8 +1,6 @@ - - @@ -15,6 +13,40 @@
Project Lombok

@Getter and @Setter

+

Overview

+

+ You can annotate any field with @Getter and/or @Setter, to let lombok generate the default getter/setter automatically.
+ A default getter simply returns the field, and is named getFoo if the field is called foo (or isFoo) + if the field's type is boolean. A default setter is named setFoo if the field is called foo, returns void, + and takes 1 parameter of the same type as the field. It simply sets the field to this value. +

+ The generated getter/setter method will be public unless you explicitly specify an AccessLevel, as shown in the example below. + Legal access levels are PUBLIC, PROTECTED, PACKAGE, and PRIVATE. +

+

Small print

+

+ For generating the method names, the first character of the field, if it is a lowercase character, is title-cased, otherwise, it is left unmodified. + Then, get/set/is is prefixed. +

+ No method is generated if any method already exists with the same name, even if the parameter list is different. For example, getFoo() + will not be generated if there's already a method getFoo(int x) even though it is technically possible to make the method. This caveat + exists to prevent confusion. If the generation of a method is skipped for this reason, a warning is emitted instead. +

+ Any variation on boolean will not result in using the is prefix instead of the get prefix; for example, + returning java.lang.Boolean results in a get prefix, not an is prefix. +

+
+
+
+
+

With Lombok

+
@HTML_PRE@
+
+
+
+

Vanilla Java

+
@HTML_POST@
+