Skip to content

Latest commit

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Multiline properties format for Java

Build StatusCoverage StatusMaven CentralIntellij IDEA pluginLicense

Format

Any text before the first key
is considered as a comment~ key1. Keys are 1-line strings started with '~'. Leading/trailing whitespaces are removed
Multiline
Value1
~ key2
Multiline
Value2

Usage

Map<String, String> properties = newMPropsParser().parse(text);

or

Map<String, String> properties = newMPropsParser().parse(newFileReader("path-to-file"));

or with a streaming

newMPropsParser().parse(newFileReader("path-to-file"), newBiConsumer<String, String>(){...});

Using custom key token

// All keys now starts with '>' token: example: "> key \n value".MPropsParserparser = newMPropsParser(">");

Escaping values

To escape any value use starting ' ' (space) character on any value line that starts with key token. This extra leading space will be removed (not-returned) by parser.

Maven

 <dependency>
<groupId>com.github.mprops</groupId>
<artifactId>mprops</artifactId>
<version>1.1.0</version>
</dependency>

Releases

Packages

Used by

Contributors

Languages