Class XMLPropertyListConfiguration.PListNodeBuilder
java.lang.Object
org.apache.commons.configuration2.plist.XMLPropertyListConfiguration.PListNodeBuilder
- Direct Known Subclasses:
XMLPropertyListConfiguration.ArrayNodeBuilder
- Enclosing class:
XMLPropertyListConfiguration
A specialized builder class with addXXX methods to parse the typed data passed by the SAX handler. It is used for
creating the nodes of the configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection
<XMLPropertyListConfiguration.PListNodeBuilder> A collection with child builders of this builder.private static final DateFormat
The MacOS FORMAT of dates in plist files.private static final DateFormat
The GNUstep FORMAT of dates in plist files.private String
The name of the represented node.private Object
The current value of the represented node. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given child builder to this builder.void
addDataValue
(String value) Parse the specified string as a byte array in base 64 FORMAT and add it to the values of the node.void
addDateValue
(String value) Parse the specified string as a date and add it to the values of the node.void
Add a boolean value 'false' to the values of the node.void
addIntegerValue
(String value) Parse the specified string as an Interger and add it to the values of the node.void
Add a sublist to the values of the node.void
addRealValue
(String value) Parse the specified string as a Double and add it to the values of the node.void
Add a boolean value 'true' to the values of the node.void
Update the value of the node.Creates the configuration node defined by this builder.protected Object
Gets the final value for the node to be created.void
Sets the name of the represented node.
-
Field Details
-
FORMAT
The MacOS FORMAT of dates in plist files. Note: BecauseSimpleDateFormat
is not thread-safe, each access has to be synchronized. -
GNUSTEP_FORMAT
The GNUstep FORMAT of dates in plist files. Note: BecauseSimpleDateFormat
is not thread-safe, each access has to be synchronized. -
childBuilders
A collection with child builders of this builder. -
name
The name of the represented node. -
value
The current value of the represented node.
-
-
Constructor Details
-
PListNodeBuilder
private PListNodeBuilder()
-
-
Method Details
-
addChild
Adds the given child builder to this builder.- Parameters:
child
- the child builder to be added
-
addDataValue
Parse the specified string as a byte array in base 64 FORMAT and add it to the values of the node.- Parameters:
value
- the value to be added
-
addDateValue
Parse the specified string as a date and add it to the values of the node.- Parameters:
value
- the value to be added- Throws:
IllegalArgumentException
- if the date string cannot be parsed
-
addFalseValue
public void addFalseValue()Add a boolean value 'false' to the values of the node. -
addIntegerValue
Parse the specified string as an Interger and add it to the values of the node.- Parameters:
value
- the value to be added
-
addList
Add a sublist to the values of the node.- Parameters:
node
- the node whose value will be added to the current node value
-
addRealValue
Parse the specified string as a Double and add it to the values of the node.- Parameters:
value
- the value to be added
-
addTrueValue
public void addTrueValue()Add a boolean value 'true' to the values of the node. -
addValue
Update the value of the node. If the existing value is null, it's replaced with the new value. If the existing value is a list, the specified value is appended to the list. If the existing value is not null, a list with the two values is built.- Parameters:
v
- the value to be added
-
createNode
Creates the configuration node defined by this builder.- Returns:
- the newly created configuration node
-
getNodeValue
Gets the final value for the node to be created. This method is called when the represented configuration node is actually created.- Returns:
- the value of the resulting configuration node
-
setName
Sets the name of the represented node.- Parameters:
nodeName
- the node name
-