Class AbstractCanonicalMapFactory

    • Constructor Detail

      • AbstractCanonicalMapFactory

        public AbstractCanonicalMapFactory​()
    • Method Detail

      • postProcessAttributes

        protected void postProcessAttributes​(org.refcodes.structure.CanonicalMap.CanonicalMapBuilder aProperties)
        This method takes care on giving nodes with children an own value: E.g. "yaml" files cannot have a value for a node which has sub-nodes, same applies to "json" and "xml" which makes using the "mixed content" mechanism hard. When we require a value for a node (path) which may have sub-nodes (sub-paths), then e.g. a this sub-node assigns a value to it's parent node. E.g. For "xml", the attribute this="value" attached to an element takes care on giving an XML element with children an own value. See THIS_ATTRIBUTES.
        Parameters:
        aProperties - The properties where the "this" children are to assign a value to their parents.
      • toDelimiter

        protected char toDelimiter​(Map<String,String> aProperties,
                                   char aDefaultDelimiter)
        Retrieves the delimiter to be used for the data structure.
        Parameters:
        aProperties - The properties from which to retrieve the delimiter.
        aDefaultDelimiter - The delimiter to be used when there is none in the properties defined.
        Returns:
        The according delimiter or the PathMap.DELIMITER if none was provided in the properties.
      • toSupportedDelimiters

        protected char[] toSupportedDelimiters​(Map<String,String> aProperties)
        Retrieves the supported delimiters to be used when unmarshaling an external representation.
        Parameters:
        aProperties - The properties from which to retrieve the supported delimiters. Them delimiters are provided in a String.
        Returns:
        The according supported delimiters or the PathMap.DELIMITER if none was provided in the properties.
      • toComment

        protected String toComment​(Map<String,String> aProperties)
        Retrieves the comment to be used in the header of the marshaled representation.
        Parameters:
        aProperties - The properties from which to retrieve the comment.
        Returns:
        The according delimiter or the CanonicalMap.DEFAULT_COMMENT if none was provided in the properties.
      • toXml

        protected static String toXml​(org.refcodes.structure.CanonicalMap aCanonicalMap)
        Converts a CanonicalMap to XML.
        Parameters:
        aCanonicalMap - The CanonicalMap to marshal.
        Returns:
        The resulting XML.