Class XMLPropertyListConfiguration.PListNodeBuilder

java.lang.Object
org.apache.commons.configuration2.plist.XMLPropertyListConfiguration.PListNodeBuilder
Direct Known Subclasses:
XMLPropertyListConfiguration.ArrayNodeBuilder
Enclosing class:
XMLPropertyListConfiguration

private static class XMLPropertyListConfiguration.PListNodeBuilder extends Object
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 Details

    • FORMAT

      private static final DateFormat FORMAT
      The MacOS FORMAT of dates in plist files. Note: Because SimpleDateFormat is not thread-safe, each access has to be synchronized.
    • GNUSTEP_FORMAT

      private static final DateFormat GNUSTEP_FORMAT
      The GNUstep FORMAT of dates in plist files. Note: Because SimpleDateFormat is not thread-safe, each access has to be synchronized.
    • childBuilders

      A collection with child builders of this builder.
    • name

      private String name
      The name of the represented node.
    • value

      private Object value
      The current value of the represented node.
  • Constructor Details

    • PListNodeBuilder

      private PListNodeBuilder()
  • Method Details

    • addChild

      public void addChild(XMLPropertyListConfiguration.PListNodeBuilder child)
      Adds the given child builder to this builder.
      Parameters:
      child - the child builder to be added
    • addDataValue

      public 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.
      Parameters:
      value - the value to be added
    • addDateValue

      public void addDateValue(String value)
      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

      public void addIntegerValue(String value)
      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

      public void addRealValue(String value)
      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

      public void addValue(Object v)
      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

      public ImmutableNode createNode()
      Creates the configuration node defined by this builder.
      Returns:
      the newly created configuration node
    • getNodeValue

      protected Object 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

      public void setName(String nodeName)
      Sets the name of the represented node.
      Parameters:
      nodeName - the node name