Class AbstractCanonicalMapFactory

  • All Implemented Interfaces:
    org.refcodes.factory.MarshalTypeFactory<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.lang.String>, org.refcodes.factory.MarshalTypeFactory.MarshalTypeFactoryComplement<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.lang.String>, org.refcodes.factory.MarshalTypeFactory.MarshalTypeFactoryComposite<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.lang.String,java.io.InputStream>, org.refcodes.factory.UnmarshalTypeFactory<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.lang.String>, org.refcodes.factory.UnmarshalTypeFactory.UnmarshalTypeFactoryComplement<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.lang.String>, org.refcodes.factory.UnmarshalTypeFactory.UnmarshalTypeFactoryComposite<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.lang.String,java.io.InputStream>, CanonicalMapFactory
    Direct Known Subclasses:
    HtmlCanonicalMapFactory, JavaCanonicalMapFactory, JsonCanonicalMapFactory, TomlCanonicalMapFactory, XmlCanonicalMapFactory, YamlCanonicalMapFactory


    public abstract class AbstractCanonicalMapFactory
    extends java.lang.Object
    implements CanonicalMapFactory
    Base class for the CanonicalMapFactory providing base functionality.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.factory.MarshalTypeFactory

        org.refcodes.factory.MarshalTypeFactory.MarshalTypeFactoryComplement<T extends java.lang.Object,C extends java.lang.Object>, org.refcodes.factory.MarshalTypeFactory.MarshalTypeFactoryComposite<T extends java.lang.Object,SRC extends java.lang.Object,C extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.factory.UnmarshalTypeFactory

        org.refcodes.factory.UnmarshalTypeFactory.UnmarshalTypeFactoryComplement<T extends java.lang.Object,C extends java.lang.Object>, org.refcodes.factory.UnmarshalTypeFactory.UnmarshalTypeFactoryComposite<T extends java.lang.Object,SRC extends java.lang.Object,C extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void postProcessAttributes​(org.refcodes.structure.CanonicalMap.CanonicalMapBuilder aProperties)  
      protected java.lang.String toComment​(java.util.Map<java.lang.String,java.lang.String> aProperties)
      Retrieves the comment to be used in the header of the marshaled representation.
      protected char toDelimiter​(java.util.Map<java.lang.String,java.lang.String> aProperties, char aDefaultDelimiter)
      Retrieves the delimiter to be used for the data structure.
      protected java.io.InputStream toInputStream​(java.lang.String aString)
      Converts the given String to an InputStream.
      protected java.lang.String toString​(java.io.InputStream aInputStream)
      Converts the given InputStream to a String.
      protected char[] toSupportedDelimiters​(java.util.Map<java.lang.String,java.lang.String> aProperties)
      Retrieves the supported delimiters to be used when unmarshaling an external representation.
      • Methods inherited from interface org.refcodes.factory.MarshalTypeFactory.MarshalTypeFactoryComplement

        fromUnmarshaled, fromUnmarshaled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.refcodes.factory.UnmarshalTypeFactory.UnmarshalTypeFactoryComplement

        fromMarshaled, fromMarshaled
    • Constructor Detail

      • AbstractCanonicalMapFactory

        public AbstractCanonicalMapFactory​()
    • Method Detail

      • postProcessAttributes

        protected void postProcessAttributes​(org.refcodes.structure.CanonicalMap.CanonicalMapBuilder aProperties)
      • toString

        protected java.lang.String toString​(java.io.InputStream aInputStream)
                                     throws java.io.IOException
        Converts the given InputStream to a String.
        Parameters:
        aInputStream - The InputStream to be converted.
        Returns:
        The according String.
        Throws:
        java.io.IOException - thrown in case conversion failed.
      • toInputStream

        protected java.io.InputStream toInputStream​(java.lang.String aString)
        Converts the given String to an InputStream.
        Parameters:
        aString - The String to be converted.
        Returns:
        The according InputStream.
      • toDelimiter

        protected char toDelimiter​(java.util.Map<java.lang.String,java.lang.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.DEFAULT_DELIMITER if none was provided in the properties.
      • toSupportedDelimiters

        protected char[] toSupportedDelimiters​(java.util.Map<java.lang.String,java.lang.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.DEFAULT_DELIMITER if none was provided in the properties.
      • toComment

        protected java.lang.String toComment​(java.util.Map<java.lang.String,java.lang.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.