|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
java.io.BufferedReader
java.io.LineNumberReader
org.apache.commons.configuration.PropertiesConfiguration.PropertiesReader
public static class PropertiesConfiguration.PropertiesReader
This class is used to read properties lines. These lines do not terminate with new-line chars but rather when there is no backslash sign a the end of the line. This is used to concatenate multiple lines for readability.
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
PropertiesConfiguration.PropertiesReader(Reader reader)
Constructor. |
|
PropertiesConfiguration.PropertiesReader(Reader reader,
char listDelimiter)
Creates a new instance of PropertiesReader and sets
the underlying reader and the list delimiter. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.io.LineNumberReader |
---|
getLineNumber, mark, read, read, readLine, reset, setLineNumber, skip |
Methods inherited from class java.io.BufferedReader |
---|
close, markSupported, ready |
Methods inherited from class java.io.Reader |
---|
read, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertiesConfiguration.PropertiesReader(Reader reader)
reader
- A Reader.public PropertiesConfiguration.PropertiesReader(Reader reader, char listDelimiter)
PropertiesReader
and sets
the underlying reader and the list delimiter.
reader
- the readerlistDelimiter
- the list delimiter characterMethod Detail |
---|
public String readProperty() throws IOException
<name>
= <value>
)
IOException
- in case of an I/O errorpublic boolean nextProperty() throws IOException
IOException
- if an error occurspublic 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 property
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |