public static class PropertiesConfiguration.PropertiesReader extends LineNumberReader
Constructor and Description |
---|
PropertiesReader(Reader reader)
Constructor.
|
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.
|
protected String |
unescapePropertyName(String name)
Performs unescaping on the given property name.
|
protected String |
unescapePropertyValue(String value)
Performs unescaping on the given property value.
|
getLineNumber, mark, read, read, readLine, reset, setLineNumber, skip
close, lines, markSupported, ready
public PropertiesReader(Reader reader)
reader
- A Reader.public List<String> getCommentLines()
readProperty()
public String getPropertyName()
nextProperty()
was invoked and
its return value was true.public String getPropertySeparator()
public String getPropertyValue()
nextProperty()
was invoked and
its return value was true.protected 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 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 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 propertypublic boolean nextProperty() throws IOException
IOException
- if an error occursprotected void parseProperty(String line)
initPropertyXXX()
methods.line
- the line read from the properties filepublic String readProperty() throws IOException
<name>
=
<value>
)IOException
- in case of an I/O errorprotected String unescapePropertyName(String name)
name
- the property nameprotected String unescapePropertyValue(String value)
value
- the property valueCopyright © 2001–2022 The Apache Software Foundation. All rights reserved.