Class XMLPropertyListConfiguration.PListNodeBuilder

  • Direct Known Subclasses:
    XMLPropertyListConfiguration.ArrayNodeBuilder
    Enclosing class:
    XMLPropertyListConfiguration

    private static class XMLPropertyListConfiguration.PListNodeBuilder
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Collection<XMLPropertyListConfiguration.PListNodeBuilder> childBuilders
      A collection with child builders of this builder.
      private static java.text.DateFormat FORMAT
      The MacOS FORMAT of dates in plist files.
      private static java.text.DateFormat GNUSTEP_FORMAT
      The GNUstep FORMAT of dates in plist files.
      private java.lang.String name
      The name of the represented node.
      private java.lang.Object value
      The current value of the represented node.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PListNodeBuilder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChild​(XMLPropertyListConfiguration.PListNodeBuilder child)
      Adds the given child builder to this builder.
      void addDataValue​(java.lang.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​(java.lang.String value)
      Parse the specified string as a date and add it to the values of the node.
      void addFalseValue()
      Add a boolean value 'false' to the values of the node.
      void addIntegerValue​(java.lang.String value)
      Parse the specified string as an Interger and add it to the values of the node.
      void addList​(XMLPropertyListConfiguration.ArrayNodeBuilder node)
      Add a sublist to the values of the node.
      void addRealValue​(java.lang.String value)
      Parse the specified string as a Double and add it to the values of the node.
      void addTrueValue()
      Add a boolean value 'true' to the values of the node.
      void addValue​(java.lang.Object v)
      Update the value of the node.
      ImmutableNode createNode()
      Creates the configuration node defined by this builder.
      protected java.lang.Object getNodeValue()
      Gets the final value for the node to be created.
      void setName​(java.lang.String nodeName)
      Sets the name of the represented node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FORMAT

        private static final java.text.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 java.text.DateFormat GNUSTEP_FORMAT
        The GNUstep FORMAT of dates in plist files. Note: Because SimpleDateFormat is not thread-safe, each access has to be synchronized.
      • name

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

        private java.lang.Object value
        The current value of the represented node.
    • Constructor Detail

      • PListNodeBuilder

        private PListNodeBuilder()
    • Method Detail

      • addDataValue

        public void addDataValue​(java.lang.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​(java.lang.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:
        java.lang.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​(java.lang.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
      • addRealValue

        public void addRealValue​(java.lang.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​(java.lang.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 java.lang.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​(java.lang.String nodeName)
        Sets the name of the represented node.
        Parameters:
        nodeName - the node name