原理:根据实体类上的标签,生成一个新的实体类。然后再进行编译
官方文档地址:https://projectlombok.org/features/
文档首页:
======================================================================================================
val@NonNull@Cleanupclose() methods safely with no hassle.@Getter / @Setterpublic int getFoo() {return foo;} again.@ToStringtoString for you!@EqualsAndHashCodehashCode and equals implementations from the fields of your object.@NoArgsConstructor, @RequiredArgsConstructor and @AllArgsConstructor@Data@ToString, @EqualsAndHashCode, @Getter on all fields, and @Setter on all non-final fields, and @RequiredArgsConstructor!@Value@Builder@SneakyThrows@Synchronizedsynchronized done right: Don‘t expose your locks.@Getter(lazy=true)@Loglombok.jar in your IDE, you can also check out the javadoc.Execute lombok.jar (doubleclick it, or run java -jar lombok.jar). Follow instructions.
Include lombok.jar on the classpath as you compile. That‘s all there is to it!
Lombok hosts its own maven repository, so adding lombok to maven is very simple. full instructions are here.
See gwt setup.
Use delombok first, then run javadoc or GWT on the delombok-ed code.
@Getter
back into the actual getter. It then removes the annotation. This is
useful for all sorts of reasons; you can check out what‘s happening
under the hood,
if the unthinkable happens and you want to stop using lombok, you
can easily remove all traces of it in your source, and you can use
delombok to preprocess
your source files for source-level tools such as javadoc and GWT.
More information about how to run delombok, including instructions for
build tools
can be found at the delombok page.原文:http://www.cnblogs.com/wangyongxia/p/6700861.html