Class XMLPropertyListConfiguration

    • Field Detail

      • INDENT_SIZE

        private static final int INDENT_SIZE
        Size of the indentation for the generated file.
        See Also:
        Constant Field Values
      • DATA_ENCODING

        private static final java.nio.charset.Charset DATA_ENCODING
        Constant for the encoding for binary data.
      • locator

        private FileLocator locator
        Temporarily stores the current file location.
    • Constructor Detail

      • XMLPropertyListConfiguration

        public XMLPropertyListConfiguration()
        Creates an empty XMLPropertyListConfiguration object which can be used to synthesize a new plist file by adding values and then saving().
      • XMLPropertyListConfiguration

        public XMLPropertyListConfiguration​(HierarchicalConfiguration<ImmutableNode> configuration)
        Creates a new instance of XMLPropertyListConfiguration and copies the content of the specified configuration into this object.
        Parameters:
        configuration - the configuration to copy
        Since:
        1.4
      • XMLPropertyListConfiguration

        XMLPropertyListConfiguration​(ImmutableNode root)
        Creates a new instance of XMLPropertyConfiguration with the given root node.
        Parameters:
        root - the root node
    • Method Detail

      • transformMap

        private static java.util.Map<java.lang.String,​java.lang.Object> transformMap​(java.util.Map<?,​?> src)
        Transform a map of arbitrary types into a map with string keys and object values. All keys of the source map which are not of type String are dropped.
        Parameters:
        src - the map to be converted
        Returns:
        the resulting map
      • addPropertyInternal

        protected void addPropertyInternal​(java.lang.String key,
                                           java.lang.Object value)
        Description copied from class: AbstractHierarchicalConfiguration
        Adds the property with the specified key. This task will be delegated to the associated ExpressionEngine, so the passed in key must match the requirements of this implementation.
        Overrides:
        addPropertyInternal in class AbstractHierarchicalConfiguration<ImmutableNode>
        Parameters:
        key - the key of the new property
        value - the value of the new property
      • initFileLocator

        public void initFileLocator​(FileLocator locator)
        Stores the current file locator. This method is called before I/O operations.
        Specified by:
        initFileLocator in interface FileLocatorAware
        Parameters:
        locator - the current FileLocator
      • printNode

        private void printNode​(java.io.PrintWriter out,
                               int indentLevel,
                               ImmutableNode node)
        Append a node to the writer, indented according to a specific level.
      • printValue

        private void printValue​(java.io.PrintWriter out,
                                int indentLevel,
                                java.lang.Object value)
        Append a value to the writer, indented according to a specific level.
      • read

        public void read​(java.io.Reader in)
                  throws ConfigurationException
        Description copied from interface: FileBased
        Reads the content of this object from the given reader. Client code should not call this method directly, but use a FileHandler for reading data.
        Specified by:
        read in interface FileBased
        Parameters:
        in - the reader
        Throws:
        ConfigurationException - if a non-I/O related problem occurs, e.g. the data read does not have the expected format
      • setPropertyDirect

        private void setPropertyDirect​(java.lang.String key,
                                       java.lang.Object value)
      • write

        public void write​(java.io.Writer out)
                   throws ConfigurationException
        Description copied from interface: FileBased
        Writes the content of this object to the given writer. Client code should not call this method directly, but use a FileHandler for writing data.
        Specified by:
        write in interface FileBased
        Parameters:
        out - the writer
        Throws:
        ConfigurationException - if a non-I/O related problem occurs, e.g. the data read does not have the expected format