public static class Properties.PropertiesReader
extends java.io.LineNumberReader
Type | Property and Description |
---|---|
boolean |
next
Parses the next property from the input stream and stores the found
name and value in internal fields.
|
java.lang.String |
read
Reads a property line.
|
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
commentLines
Stores the comment lines for the currently processed property.
|
private boolean |
maybeTyped |
private java.lang.String |
propertyName
Stores the name of the last read property.
|
private java.lang.String |
propertyValue
Stores the value of the last read property.
|
(package private) java.lang.Boolean |
typed
Stores if the properties are typed or not
|
private java.util.List<java.lang.String> |
valueLines
Stores the value lines for the currently processed property.
|
Constructor and Description |
---|
PropertiesReader(java.io.Reader reader,
boolean maybeTyped)
Creates a new instance of
PropertiesReader and sets
the underlaying reader and the list delimiter. |
Modifier and Type | Method and Description |
---|---|
private static boolean |
checkCombineLines(java.lang.String line)
Checks if the passed in line should be combined with the following.
|
java.util.List<java.lang.String> |
getCommentLines()
Returns the comment lines that have been read for the last property.
|
java.lang.String |
getPropertyName()
Returns the name of the last read property.
|
java.lang.String |
getPropertyValue()
Returns the value of the last read property.
|
java.util.List<java.lang.String> |
getValueLines()
Returns the value lines that have been read for the last property.
|
boolean |
nextProperty()
Parses the next property from the input stream and stores the found
name and value in internal fields.
|
private static java.lang.String[] |
parseProperty(java.lang.String line)
Parse a property line and return the key and the value in an array.
|
java.lang.String |
readProperty()
Reads a property line.
|
public java.lang.String readProperty
<name>
= <value>
)java.io.IOException
public boolean nextProperty
java.io.IOException
private final java.util.List<java.lang.String> commentLines
private final java.util.List<java.lang.String> valueLines
private java.lang.String propertyName
private java.lang.String propertyValue
private boolean maybeTyped
java.lang.Boolean typed
public PropertiesReader(java.io.Reader reader, boolean maybeTyped)
PropertiesReader
and sets
the underlaying reader and the list delimiter.reader
- the readerpublic java.lang.String readProperty() throws java.io.IOException
<name>
= <value>
)java.io.IOException
public boolean nextProperty() throws java.io.IOException
java.io.IOException
public java.util.List<java.lang.String> getCommentLines()
readProperty()
public java.util.List<java.lang.String> getValueLines()
readProperty()
public java.lang.String getPropertyName()
nextProperty()
was invoked and its
return value was true.public java.lang.String getPropertyValue()
nextProperty()
was invoked and
its return value was true.private static boolean checkCombineLines(java.lang.String line)
line
- the lineprivate static java.lang.String[] parseProperty(java.lang.String line)
line
- the line to parse