(EXT) Eclipse installation Lombok

Source: Internet
Author: User
Tags log4j

Lombok's official website: http://projectlombok.org/
1. Installation of Lombok :
The use of Lombox is required to install, if not installed, the IDE will not be able to parse Lombox annotations, there are two ways to install Lombok;

①. In the command line to execute the Java-jar Lombox.jar package location, for example: Java-jar d:/lombok.jar pop-up Select the IDE installation path of the prompt box, select the IDE's installation path, click Install/update to install. After the installation is complete, the installation directory for Eclipse has a Lombok.jar package, and the following two lines in Eclipse.ini indicate that the installation was successful.

②. The second way to install is to manually install the Lombok.jar package into the installation directory of Eclipse, and add the following two lines to the Eclipse.ini file.

-xbootclasspath/a:lombok.jar    --Note: It's no problem if you don't have this line-javaagent:lombok.jar

Restart Eclipse. But in your project you want to Lombok the annotations to take effect, you also need to add Lombok.jar to your project, if it is a MAVEN project, the following code is added to the pom file:

<Dependency>    <groupId>Org.projectlombok</groupId>    <Artifactid>Lombok</Artifactid>    <version>1.16.12</version>    <Scope>Provided</Scope></Dependency>

2. Lombok Annotations
Lombok Annotations Online Help documentation: Http://projectlombok.org/features/index.
Common annotations:
@Data: Annotations are on classes, provide getting and setting methods for all properties of a class, and also provide equals, canequal, Hashcode, toString methods
@Setter: Annotations on attributes; providing setting methods for attributes
@Getter: Annotations on attributes; providing getting methods for attributes
@Log4j: Annotations are on a class, and a log4j log object with a property named log is provided for the class
@NoArgsConstructor: Annotations on a class, providing an argument-free construction method for a class
@AllArgsConstructor: Annotations are on a class, and a method for constructing a class with full parameters

(EXT) Eclipse installation Lombok

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.