Class MapType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable

    public class MapType
    extends Type
    This type represents a typed map. Both argument type and element type is typed.

    Map types fulfil s special role describing localized attributes since each localized attribute must point to a map type having the Language composed type as argument type and the actual attribute type as return type.

    See Also:
    Serialized Form
    • Field Detail

      • ARGUMENT_TYPE

        public static final java.lang.String ARGUMENT_TYPE
        The argument type attribute string constant.
      • RETURN_TYPE

        public static final java.lang.String RETURN_TYPE
        The element (or return ) type attribute string constant.
    • Constructor Detail

      • MapType

        public MapType()
    • Method Detail

      • getEscapedMapPositions

        public static int[] getEscapedMapPositions​(java.lang.String escaped,
                                                   int startFrom)
        Since:
        2.10
      • escapeForMap

        protected static final java.lang.String escapeForMap​(java.lang.String raw)
        Since:
        2.10
      • unescapeForMap

        protected static final java.lang.String unescapeForMap​(java.lang.String escaped)
        Since:
        2.10
      • getArgumentType

        public Type getArgumentType()
        Returns the argument type.
      • getArgumentType

        public Type getArgumentType​(SessionContext ctx)
        Returns the argument type.
      • getReturnType

        public Type getReturnType()
        Returns the element ( or return-) type.
      • getReturnType

        public Type getReturnType​(SessionContext ctx)
        Returns the element ( or return-) type.
      • getXMLDefinition

        public java.lang.String getXMLDefinition()
        Assembles the XML definition to put inside a items.xml .
        Specified by:
        getXMLDefinition in class Type
      • getMapTypeImpl

        protected MapType.MapTypeImpl getMapTypeImpl()
        Internal access to persistence layer implementation.
      • isAssignableFrom

        public boolean isAssignableFrom​(Type type)
        Checks if this maptype is assignable from another maptype.

        This is true if its argument type is assignable from the other type's argument type and its element type is assignable from the other type's element type.

        Specified by:
        isAssignableFrom in class Type
        Parameters:
        type - the type to be checked.
      • isInstance

        public boolean isInstance​(java.lang.Object o)
        Checks if a given object is instance of this maptype.

        This is true if the object is a map and each key is instance of the argument type and each value is instance of the element type.

        Specified by:
        isInstance in class Type
        Parameters:
        o - the object to be checked.
      • typeCheckContent

        public boolean typeCheckContent​(java.util.Map map)
        Helper method for isInstance(Object). Checks content of a map if it is compatible with the argument and element type.
      • toString

        public java.lang.String toString()
        The string representation of this map type.
        Overrides:
        toString in class Type
        Returns:
        the String representation of this item.