Class AbstractCanonicalMapFactory
- java.lang.Object
-
- org.refcodes.structure.ext.factory.AbstractCanonicalMapFactory
-
- All Implemented Interfaces:
org.refcodes.factory.MarshalTypeFactory<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.io.InputStream>
,org.refcodes.factory.MarshalTypeFactory.MarshalTypeFactoryComplement<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.io.InputStream>
,org.refcodes.factory.MarshalTypeFactory.MarshalTypeFactoryComposite<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.io.InputStream,java.lang.String>
,org.refcodes.factory.UnmarshalTypeFactory<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.io.InputStream>
,org.refcodes.factory.UnmarshalTypeFactory.UnmarshalTypeFactoryComplement<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.io.InputStream>
,org.refcodes.factory.UnmarshalTypeFactory.UnmarshalTypeFactoryComposite<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder,java.io.InputStream,java.lang.String>
,CanonicalMapFactory
- Direct Known Subclasses:
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>
-
-
Field Summary
-
Fields inherited from interface org.refcodes.structure.ext.factory.CanonicalMapFactory
COMMENT_PROPERTY, DELIMITER_PROPERTY, SUPPORTED_DELIMITERS_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description AbstractCanonicalMapFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static 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 static 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 static java.io.InputStream
toInputStream(java.lang.String aString)
Converts the givenString
to anInputStream
.protected static java.lang.String
toString(java.io.InputStream aInputStream)
Converts the givenInputStream
to aString
.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.structure.ext.factory.CanonicalMapFactory
fromMarshaled, fromMarshaled, fromUnmarshaled, fromUnmarshaled
-
-
-
-
Method Detail
-
postProcessAttributes
protected static void postProcessAttributes(org.refcodes.structure.CanonicalMap.CanonicalMapBuilder aProperties)
-
toString
protected static java.lang.String toString(java.io.InputStream aInputStream) throws java.io.IOException
Converts the givenInputStream
to aString
.- Parameters:
aInputStream
- TheInputStream
to be converted.- Returns:
- The according
String
. - Throws:
java.io.IOException
- thrown in case conversion failed.
-
toInputStream
protected static java.io.InputStream toInputStream(java.lang.String aString)
Converts the givenString
to anInputStream
.- Parameters:
aString
- TheString
to be converted.- Returns:
- The according
InputStream
.
-
toDelimiter
protected static 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 aString
.- 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.
-
-