Skip to content

Commit 5a68c66

Browse files
committed
updating readme.md
1 parent fb1275a commit 5a68c66

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,24 @@
66

77
Hermes is a Maven plugin designed to streamline the generation of fluent object builders for your Java classes. Employing a declarative approach, it produces a straightforward Domain Specific Language (DSL) to facilitate the construction of object instances.
88

9-
10-
## Annotations
11-
12-
- **@DSLRoot** - Indicates the intention to create a builder for the annotated class;
13-
- **@DSLProperty** - Customizes the method name generated for a specific field. The default is the original field name;
14-
- **@DSLIgnore** - Marks a field to be excluded when generating DSL code;
9+
## Update your pom.xml file
10+
11+
```xml
12+
<repositories>
13+
<repository>
14+
<id>jitpack.io</id>
15+
<url>https://jitpack.io</url>
16+
</repository>
17+
</repositories>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>com.github.victorhsr</groupId>
22+
<artifactId>hermes-maven-plugin</artifactId>
23+
<version>Tag</version>
24+
</dependency>
25+
</dependencies>
26+
```
1527

1628
## Usage
1729
Suppose we have classes `Person`, `Address` and `MetaDataWrapper` annotated with `@DSLRoot` and `@DSLProperty`:
@@ -67,6 +79,12 @@ Person personFromDsl =
6779

6880
Note that there's no need to instantiate `Address` or `MetaDataWrapper`, and more descriptive names for Person's fields can be used.
6981

82+
## Annotations
83+
84+
- **@DSLRoot** - Indicates the intention to create a builder for the annotated class;
85+
- **@DSLProperty** - Customizes the method name generated for a specific field. The default is the original field name;
86+
- **@DSLIgnore** - Marks a field to be excluded when generating DSL code;
87+
7088
# Comparison with Traditional Java Classes
7189

7290
The equivalent implementation in traditional Java code involves a considerable amount of boilerplate:
@@ -102,7 +120,7 @@ private Address buildAddress() {
102120
```
103121
That's a lot of code, almost twice the lines of our previous implementation. The Hermes Maven Plugin significantly reduces this boilerplate, providing a more concise and readable alternative.
104122

105-
# Using Lombok for Comparison
123+
# Using Lombok for comparison
106124

107125
An alternative approach using Lombok involves a cleaner syntax but may lack readability and customization
108126

0 commit comments

Comments
 (0)