public interface PropertiesParser
.properties
source (string, file, stream, etc) and returns a Map<String,String>
that reflects the parsed properties.
This implementation differs from default Java property loading behavior in that the returned Map's iteration order is guaranteed to be the same as the order in which the properties are read. This can be beneficial if it is desired to assign meaning to property definition order.
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
parse(Resource resource)
Parses the specified
.properties resource and returns a map of the parsed properties or an
empty map if no properties were found. |
Map<String,String> |
parse(Scanner source)
Parses the scanned content according to
.properties formatting rules and returns a map of the parsed
properties or an empty map if no properties were found. |
Map<String,String> |
parse(String source)
Parses the specified
.properties -formatted String and returns a map of the parsed properties or an
empty map if no properties were found. |
Map<String,String> parse(String source)
.properties
-formatted String and returns a map of the parsed properties or an
empty map if no properties were found.source
- the String to parseMap<String,String> parse(Resource resource) throws IOException
.properties
resource and returns a map of the parsed properties or an
empty map if no properties were found.resource
- the resource to parse.IOException
- if unable to obtain the resource's inputStream
.Map<String,String> parse(Scanner source)
.properties
formatting rules and returns a map of the parsed
properties or an empty map if no properties were found.source
- the Scanner to use to parse the contentCopyright © 2017–2023 Okta. All rights reserved.