From b37f3cba3eb7e7babd38894b890ca5fda2f57cf4 Mon Sep 17 00:00:00 2001 From: Jan Rieke Date: Mon, 11 May 2020 08:34:09 +0200 Subject: [SuperBuilder] update documentation on customizing --- website/templates/features/experimental/SuperBuilder.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'website/templates') diff --git a/website/templates/features/experimental/SuperBuilder.html b/website/templates/features/experimental/SuperBuilder.html index c929e8f5..e9a0958d 100644 --- a/website/templates/features/experimental/SuperBuilder.html +++ b/website/templates/features/experimental/SuperBuilder.html @@ -6,6 +6,8 @@ @SuperBuilder was introduced as experimental feature in lombok v1.18.2.

@SuperBuilder's toBuilder feature and limited support for customization was added with lombok v1.18.4. +

+ @SuperBuilder customization possibilities were extended with lombok v1.18.14.

@@ -13,7 +15,7 @@

The @SuperBuilder annotation produces complex builder APIs for your classes. In contrast to @Builder, @SuperBuilder also works with fields from superclasses. - However, it only works for types, and customization possibilities are limited. + However, it only works for types. Most importantly, it requires that all superclasses also have the @SuperBuilder annotation.

@SuperBuilder lets you automatically produce the code required to have your class be instantiable with code such as:
@@ -21,7 +23,7 @@

@SuperBuilder can generate so-called 'singular' methods for collection parameters/fields. For details, see the @Singular documentation in @Builder.

- @SuperBuilder generates a private constructor on the class that takes a builder instance as a parameter. This constructor sets the fields of the new instance to the values from the builder. + @SuperBuilder generates a protected constructor on the class that takes a builder instance as a parameter. This constructor sets the fields of the new instance to the values from the builder.

@SuperBuilder is not compatible with @Builder.

@@ -32,8 +34,9 @@

To ensure type-safety, @SuperBuilder generates two inner builder classes for each annotated class, one abstract and one concrete class named FoobarBuilder and FoobarBuilderImpl (where Foobar is the name of the annotated class).

- Customizing the code generated by @SuperBuilder is limited to adding new methods or annotations to the builder classes, and providing custom implementations of the 'set', builder(), and build() methods. - You have to make sure that the builder class declaration headers match those that would have been generated by lombok. Due to the heavy generics usage, we strongly advice to copy the builder class definition header from the uncustomized delomboked code. + You can customize most of the code generated by @SuperBuilder, except for internal methods (e.g. self()). + You have to make sure that the builder class declaration headers match those that would have been generated by lombok. + Due to the heavy generics usage, we strongly advice to take the uncustomized delomboked code as a reference when customizing @SuperBuilder.

The configurable aspects of builder are:

- If your identifiers are written in common english, lombok assumes that the name of any collection with @Singular on it is an english plural and will attempt to automatically singularize that name. If this is possible, the add-one method will use this name. For example, if your collection is called statuses, then the add-one method will automatically be called status. You can also specify the singular form of your identifier explictly by passing the singular form as argument to the annotation like so: @Singular("axis") List<Line> axes;.
+ If your identifiers are written in common english, lombok assumes that the name of any collection with @Singular on it is an english plural and will attempt to automatically singularize that name. If this is possible, the add-one method will use this name. For example, if your collection is called statuses, then the add-one method will automatically be called status. You can also specify the singular form of your identifier explicitly by passing the singular form as argument to the annotation like so: @Singular("axis") List<Line> axes;.
If lombok cannot singularize your identifier, or it is ambiguous, lombok will generate an error and force you to explicitly specify the singular name.

The snippet below does not show what lombok generates for a @Singular field/parameter because it is rather complicated. You can view a snippet here. diff --git a/website/templates/setup/kobalt.html b/website/templates/setup/kobalt.html index 26adf23d..beb60d8c 100644 --- a/website/templates/setup/kobalt.html +++ b/website/templates/setup/kobalt.html @@ -3,7 +3,7 @@ <@s.scaffold title="Kobalt"> <@s.introduction>

- To set up lombok with any build tool, you have to specify that the lombok dependency is required to compile your source code, but does not need to be present when running/testing/jarring/otherwise deploying your code. Generally this is called a 'provided' dependency. This page explains how to integrate lombok with the Kobalt buid tool. + To set up lombok with any build tool, you have to specify that the lombok dependency is required to compile your source code, but does not need to be present when running/testing/jarring/otherwise deploying your code. Generally this is called a 'provided' dependency. This page explains how to integrate lombok with the Kobalt build tool.

Lombok is available in maven central, so telling Kobalt to download lombok is easy.

-- cgit From 7f8e15762d4f3428d38579f702e65a4a302b1dac Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 28 Aug 2020 00:15:43 +0200 Subject: [website] [#397] [#2371] added docs for installing in eclipse via p2 --- website/resources/img/eclipse-p2-step1.png | Bin 0 -> 645640 bytes website/resources/img/eclipse-p2-step2.png | Bin 0 -> 56195 bytes website/templates/setup/eclipse.html | 12 ++++++++++++ 3 files changed, 12 insertions(+) create mode 100644 website/resources/img/eclipse-p2-step1.png create mode 100644 website/resources/img/eclipse-p2-step2.png (limited to 'website/templates') diff --git a/website/resources/img/eclipse-p2-step1.png b/website/resources/img/eclipse-p2-step1.png new file mode 100644 index 00000000..92cdef86 Binary files /dev/null and b/website/resources/img/eclipse-p2-step1.png differ diff --git a/website/resources/img/eclipse-p2-step2.png b/website/resources/img/eclipse-p2-step2.png new file mode 100644 index 00000000..84139ad8 Binary files /dev/null and b/website/resources/img/eclipse-p2-step2.png differ diff --git a/website/templates/setup/eclipse.html b/website/templates/setup/eclipse.html index 85304c83..d9621501 100644 --- a/website/templates/setup/eclipse.html +++ b/website/templates/setup/eclipse.html @@ -23,4 +23,16 @@

+ <@s.section title="Via eclipse plugin installer"> + WARNING: This plugin installer is currently unsigned, and we have given up on figuring out how to fix that; if team eclipse or somebody else can help us out, we're all ears! +

+ You can install lombok directly from within eclipse, and in that way, you can also include lombok as part of your team eclipse deployment configuration. To do this, use + update site https://projectlombok.org/p2:
+
+
+
+
+ +

+ -- cgit