Class TypeMapper


  • public class TypeMapper
    extends java.lang.Object
    Maps singleton type instances to unique names and back again. Basically, all instances of delegating types shall be mapped.
    Author:
    Holger Eichelberger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.Class<?> DELEGATING_CLASS
      Exports the meta-class of the package-local class DelegatingType.
      private static java.util.Map<java.lang.String,​IDatatype> STRING_TYPE
      Stores the name-to-type-mappings.
      private static java.util.Map<IDatatype,​java.lang.String> TYPE_STRING
      Stores the type-to-name-mappings.
    • Constructor Summary

      Constructors 
      Constructor Description
      TypeMapper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getName​(IDatatype type)
      Returns the mapping name for a type.
      static IDatatype getType​(java.lang.String name)
      Returns the mapped type for a name.
      private static void put​(java.lang.String name, IDatatype type)
      Adds a name-type-mapping.
      • Methods inherited from class java.lang.Object

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

      • DELEGATING_CLASS

        public static final java.lang.Class<?> DELEGATING_CLASS
        Exports the meta-class of the package-local class DelegatingType.
      • TYPE_STRING

        private static final java.util.Map<IDatatype,​java.lang.String> TYPE_STRING
        Stores the type-to-name-mappings.
      • STRING_TYPE

        private static final java.util.Map<java.lang.String,​IDatatype> STRING_TYPE
        Stores the name-to-type-mappings.
    • Constructor Detail

      • TypeMapper

        public TypeMapper()
    • Method Detail

      • put

        private static final void put​(java.lang.String name,
                                      IDatatype type)
        Adds a name-type-mapping.
        Parameters:
        name - the (unique) textual name of type
        type - the mapped type
      • getName

        public static final java.lang.String getName​(IDatatype type)
        Returns the mapping name for a type.
        Parameters:
        type - the type to return the mapping name for
        Returns:
        the mapping name (null in case that there is no mapping)
      • getType

        public static final IDatatype getType​(java.lang.String name)
        Returns the mapped type for a name.
        Parameters:
        name - the name to return the mapped type for
        Returns:
        the mapped type (null in case that there is no mapping)