org.apache.commons.configuration
public static class PropertiesConfiguration.PropertiesReader extends java.io.LineNumberReader
Constructor and Description |
---|
PropertiesConfiguration.PropertiesReader(java.io.Reader reader)
Constructor.
|
PropertiesConfiguration.PropertiesReader(java.io.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 |
---|---|
java.util.List |
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 |
getPropertySeparator()
Returns the separator that was used for the last read property.
|
java.lang.String |
getPropertyValue()
Returns the value of the last read property.
|
protected void |
initPropertyName(java.lang.String name)
Sets the name of the current property.
|
protected void |
initPropertySeparator(java.lang.String value)
Sets the separator of the current property.
|
protected void |
initPropertyValue(java.lang.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(java.lang.String line)
Parses a line read from the properties file.
|
java.lang.String |
readProperty()
Reads a property line.
|
public PropertiesConfiguration.PropertiesReader(java.io.Reader reader)
reader
- A Reader.public PropertiesConfiguration.PropertiesReader(java.io.Reader reader, char listDelimiter)
PropertiesReader
and sets
the underlying reader and the list delimiter.reader
- the readerlistDelimiter
- the list delimiter characterpublic java.lang.String readProperty() throws java.io.IOException
<name>
= <value>
)java.io.IOException
- in case of an I/O errorpublic boolean nextProperty() throws java.io.IOException
java.io.IOException
- if an error occurspublic java.util.List getCommentLines()
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.public java.lang.String getPropertySeparator()
protected void parseProperty(java.lang.String line)
initPropertyXXX()
methods.line
- the line read from the properties fileprotected void initPropertyName(java.lang.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(java.lang.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(java.lang.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-2014. All Rights Reserved.