diff options
Diffstat (limited to 'website')
-rw-r--r-- | website/templates/features/Builder.html | 6 | ||||
-rw-r--r-- | website/templates/features/experimental/Tolerate.html | 36 | ||||
-rw-r--r-- | website/templates/features/experimental/index.html | 6 | ||||
-rw-r--r-- | website/templates/order-license-info.html | 2 | ||||
-rw-r--r-- | website/templates/setup/javac.html | 4 | ||||
-rw-r--r-- | website/templates/tidelift.html | 2 | ||||
-rw-r--r-- | website/usageExamples/experimental/Tolerate_post.jpage | 8 | ||||
-rw-r--r-- | website/usageExamples/experimental/Tolerate_pre.jpage | 11 |
8 files changed, 68 insertions, 7 deletions
diff --git a/website/templates/features/Builder.html b/website/templates/features/Builder.html index d22877ea..08ff1ec8 100644 --- a/website/templates/features/Builder.html +++ b/website/templates/features/Builder.html @@ -68,10 +68,12 @@ If you want <code>toBuilder()</code> (default: no) </li><li> The access level of all generated elements (default: <code>public</code>). + </li><li> + (discouraged) If you want your builder's 'set' methods to have a prefix, i.e. <code>Person.builder().setName("Jane").build()</code> instead of <code>Person.builder().name("Jane").build()</code> and what it should be. </li> </ul> Example usage where all options are changed from their defaults:<br /> - <code>@Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true, access = AccessLevel.PRIVATE)</code><br /> + <code>@Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true, access = AccessLevel.PRIVATE, setterPrefix = "set")</code><br /> </p> </@f.overview> @@ -132,6 +134,8 @@ If lombok cannot singularize your identifier, or it is ambiguous, lombok will generate an error and force you to explicitly specify the singular name. </p><p> The snippet below does not show what lombok generates for a <code>@Singular</code> field/parameter because it is rather complicated. You can view a snippet <a href="builderSingular">here</a>. + </p><p> + If also using <code>setterPrefix = "with"</code>, the generated names are, for example, <code>withName</code> (add 1 name), <code>withNames</code> (add many names), and <code>clearNames</code> (reset all names). </p> </@f.featureSection> diff --git a/website/templates/features/experimental/Tolerate.html b/website/templates/features/experimental/Tolerate.html new file mode 100644 index 00000000..fc0eeb35 --- /dev/null +++ b/website/templates/features/experimental/Tolerate.html @@ -0,0 +1,36 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@Tolerate" logline="Skip, jump, and forget! Make lombok disregard an existing method or constructor."> + <@f.history> + <p> + <code>@Tolerate</code> was introduced as feature in lombok v1.14.2<br /> + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + Not used that much. + </li> + <li> + Difficult to support for edge cases, such as recursive delegation. + </li> + </ul> + </@f.experimental> + + <@f.overview> + <p> + Any method or constructor can be annotated with <code>@Tolerate</code> and lombok will act as if it + does not exist. For example, normally lombok would not generate a <code>setDate</code> method for field + named <code>date</code> if you already have a method named <code>setDate</code> in your code already. By + annotating that method with <code>@Tolerate</code>, lombok will generate it anyway. This can be useful if the + type of the parameter of your existing method is different and doesn't clash. + </p> + <p> + Put on any method or constructor to make lombok pretend it doesn't exist, i.e., to generate a method + which would otherwise be skipped due to possible conflicts. + </p> + </@f.overview> + + <@f.snippets name="experimental/Tolerate" /> +</@f.scaffold> diff --git a/website/templates/features/experimental/index.html b/website/templates/features/experimental/index.html index 960f4b1a..b158d381 100644 --- a/website/templates/features/experimental/index.html +++ b/website/templates/features/experimental/index.html @@ -9,7 +9,7 @@ </div> <div class="row"> The <a href="/api/">Lombok javadoc</a> is available, but we advise these pages. - + <p> Experimental features are available in your normal lombok installation, but are not as robustly supported as lombok's main features. In particular, experimental features: <ul> @@ -67,6 +67,10 @@ <@main.feature title="@SuperBuilder" href="SuperBuilder"> Bob now knows his ancestors: Builders with fields from superclasses, too. </@main.feature> + + <@main.feature title="@Tolerate" href="Tolerate"> + Skip, jump, and forget! Make lombok disregard an existing method or constructor. + </@main.feature> </div> <@f.confKeys> diff --git a/website/templates/order-license-info.html b/website/templates/order-license-info.html index f5839c0a..46dafd66 100644 --- a/website/templates/order-license-info.html +++ b/website/templates/order-license-info.html @@ -9,7 +9,7 @@ <p> Tidelift offers professional support of open source tools. When you have a Tidelift subscription, they will help you inventory all the various open source tools and libraries you use, give one central location to check compliance, and a single channel for release notes and security advisories. The bulk of the tidelift subscription fee is redistributed to major open source projects, and Project Lombok is one of those 'lifted' projects. Therefore, your Tidelift subscription helps maintain Project Lombok! </p><p> - We recommend a <a class="tidelift-link-inline" href="https://tidelift.com/subscription/pkg/maven-org-projectlombok-lombok?utm_source=lombok&utm_medium=referral&utm_campaign=orderdonate">Tidelift subscription</a> to any corporation that uses Project Lombok. + We recommend a <a class="tidelift-link-inline" href="https://tidelift.com/subscription/pkg/maven-org-projectlombok-lombok?utm_source=maven-org-projectlombok-lombok&utm_medium=referral&utm_campaign=orderdonate">Tidelift subscription</a> to any corporation that uses Project Lombok. </div> <div class="row text-center"> <h2>Order a professional or enterprise license</h2> diff --git a/website/templates/setup/javac.html b/website/templates/setup/javac.html index 48b0ebcf..96bd8c2b 100644 --- a/website/templates/setup/javac.html +++ b/website/templates/setup/javac.html @@ -11,15 +11,13 @@ <p> Support for JDK9, if you haven't modularized your own projects yet (no <code>module-info.java</code> yet), is included in lombok starting with version 1.16.20. Just use lombok as normal: <code> javac -cp lombok.jar ...</code> </p><p> - Support for JDK9 if you did modularize your own projects (you've written a <code>module-info.java</code> file) is available in the <a href="/download-edge">edge release</a>. To use it: <code>javac -cp lombok.jar -p lombok.jar ...</code><br /> + Support for JDK9 if you did modularize your own projects (you've written a <code>module-info.java</code> file):<br /><code>javac -cp lombok.jar -p lombok.jar ...</code><br /> Note that you will have to add lombok to your <code>module-info.java</code> file:<pre> module <em>myapp</em> { requires static lombok; }</pre> </p><p> The 'static' part ensures that you won't need lombok to be present at runtime. - </p><p> - Feedback about JDK9 module-info support can be given at <a href="https://github.com/rzwitserloot/lombok/issues/985">github issue #985</a>. </p> </@s.section> </@s.scaffold> diff --git a/website/templates/tidelift.html b/website/templates/tidelift.html index 7f0ab88b..3d020d7a 100644 --- a/website/templates/tidelift.html +++ b/website/templates/tidelift.html @@ -14,7 +14,7 @@ </p> </div> <div class="row text-center"> - <a class="tideliftb tideliftb1" href="https://tidelift.com/subscription/pkg/maven-org-projectlombok-lombok?utm_source=lombok&utm_medium=referral&utm_campaign=enterprise">LEARN MORE</a> <a class="tideliftb tideliftb2" href="https://tidelift.com/subscription/request-a-demo?utm_source=lombok&utm_medium=referral&utm_campaign=enterprise">REQUEST A DEMO</a> + <a class="tideliftb tideliftb1" href="https://tidelift.com/subscription/pkg/maven-org-projectlombok-lombok?utm_source=maven-org-projectlombok-lombok&utm_medium=referral&utm_campaign=enterprise">LEARN MORE</a> <a class="tideliftb tideliftb2" href="https://tidelift.com/subscription/request-a-demo?utm_source=maven-org-projectlombok-lombok&utm_medium=referral&utm_campaign=enterprise">REQUEST A DEMO</a> </div> <div class="row text-center"> <h2>The Tidelift Subscription manages your dependencies for you</h2> diff --git a/website/usageExamples/experimental/Tolerate_post.jpage b/website/usageExamples/experimental/Tolerate_post.jpage new file mode 100644 index 00000000..57f29e1b --- /dev/null +++ b/website/usageExamples/experimental/Tolerate_post.jpage @@ -0,0 +1,8 @@ +public class TolerateExample { + @Setter + private Date date; + + public void setDateFromString(String date) { + this.date = Date.valueOf(date); + } +} diff --git a/website/usageExamples/experimental/Tolerate_pre.jpage b/website/usageExamples/experimental/Tolerate_pre.jpage new file mode 100644 index 00000000..5723df5c --- /dev/null +++ b/website/usageExamples/experimental/Tolerate_pre.jpage @@ -0,0 +1,11 @@ +import lombok.experimental.Tolerate; + +public class TolerateExample { + @Setter + private Date date; + + @Tolerate + public void setDate(String date) { + this.date = Date.valueOf(date); + } +} |