-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.TXT
45 lines (36 loc) · 1.66 KB
/
README.TXT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
===========================================================================================
Shell-format for Java
===========================================================================================
A Java formatting tool suitable for parsing complex strings.
Developed for parsing HQL, suitable for multiline, nested variables.
Example: Hello, ${name}!
See also standard Java formatters String#format(pattern, args) and MessageFormat#format(pattern, args)
===========================================================================================
Maven:
===========================================================================================
<dependency>
<groupId>me.format</groupId>
<artifactId>java-shell-format</artifactId>
<version>1.0.0</version>
</dependency>
<!-- use SPI for SLF4J according to your choice -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.0.9</version>
</dependency>
===========================================================================================
Simple snippet:
===========================================================================================
ShellFormat shellFormat = ShellFormat.dictionary(
"pom", "World${exm}",
"exm", "!!!"
).compile();
String result = shellFormat.format("Hello $pom");
System.out.println(result); //Hello World!!!
===========================================================================================