public static class PropertiesConfiguration.PropertiesReader extends 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.
|
String |
read
Reads a property line.
|
Constructor and Description |
---|
PropertiesReader(Reader reader)
Constructor.
|
PropertiesReader(Reader reader,
char listDelimiter)
Creates a new instance of
PropertiesReader and sets
the underlying reader and the list delimiter. |
Modifier and Type | Method and Description |
---|---|
List<String> |
getCommentLines()
Returns the comment lines that have been read for the last property.
|
String |
getPropertyName()
Returns the name of the last read property.
|
String |
getPropertySeparator()
Returns the separator that was used for the last read property.
|
String |
getPropertyValue()
Returns the value of the last read property.
|
protected void |
initPropertyName(String name)
Sets the name of the current property.
|
protected void |
initPropertySeparator(String value)
Sets the separator of the current property.
|
protected void |
initPropertyValue(String value)
Sets the value of the current property.
|
boolean |
nextProperty()
Parses the next property from the input stream and stores the found
name and value in internal fields.
|
protected void |
parseProperty(String line)
Parses a line read from the properties file.
|
String |
readProperty()
Reads a property line.
|
getLineNumber, mark, read, read, readLine, reset, setLineNumber, skip
close, lines, markSupported, ready
public String readProperty
<name>
= <value>
)IOException
public boolean nextProperty
IOException
public PropertiesReader(Reader reader)
reader
- A Reader.public PropertiesReader(Reader reader, char listDelimiter)
PropertiesReader
and sets
the underlying reader and the list delimiter.reader
- the readerlistDelimiter
- the list delimiter characterpublic String readProperty() throws IOException
<name>
= <value>
)IOException
public boolean nextProperty() throws IOException
IOException
public List<String> getCommentLines()
readProperty()
public String getPropertyName()
nextProperty()
was invoked and its
return value was true.public String getPropertyValue()
nextProperty()
was invoked and
its return value was true.public String getPropertySeparator()
protected void parseProperty(String line)
initPropertyXXX()
methods.line
- the line read from the properties fileprotected void initPropertyName(String name)
parseProperty()
for storing the results of the parse
operation. It also ensures that the property key is correctly
escaped.name
- the name of the current propertyprotected void initPropertyValue(String value)
parseProperty()
for storing the results of the parse
operation. It also ensures that the property value is correctly
escaped.value
- the value of the current propertyprotected void initPropertySeparator(String value)
parseProperty()
. It allows the associated layout
object to keep track of the property separators. When saving the
configuration the separators can be restored.value
- the separator used for the current propertyCopyright © 2001–2017. All rights reserved.