Class AtomicType

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

    public class AtomicType
    extends Type
    Type representing simple java value objects.

    Atomic types support inheritance and may be abstract.

    See Also:
    Serialized Form
    • Field Detail

      • NULL_TOKEN

        public static final java.lang.String NULL_TOKEN
        Since:
        2.10
        See Also:
        Constant Field Values
      • SUPER_TYPE

        public static final java.lang.String SUPER_TYPE
        The supertype attribute string constant.
        See Also:
        Constant Field Values
      • SUBTYPES

        public static final java.lang.String SUBTYPES
        The subtypes attribute string constant.
        See Also:
        Constant Field Values
      • JAVA_CLASS

        public static final java.lang.String JAVA_CLASS
        The java class attribute string constant.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AtomicType

        public AtomicType()
    • Method Detail

      • escape

        public static java.lang.String escape​(java.lang.String raw,
                                              char escapedChar)
        Escapes all & by placing a \ in front.
        Since:
        2.10
      • getEscapedStringPositions

        public static int[] getEscapedStringPositions​(java.lang.String escaped,
                                                      char escapedChar,
                                                      int startFrom)
        Since:
        2.10
      • unescape

        public static java.lang.String unescape​(java.lang.String escaped,
                                                char escapeChar)
        Since:
        2.10
      • toString

        public java.lang.String toString​(SessionContext ctx,
                                         java.lang.Object value)
                                  throws JaloInvalidParameterException
        Writes a atomic value as '&' + escaped string value + '&'. The escaped string value is the string representation of the actual value except that each occurence of '&:' is replaced by '\&'.

        Currently supported value types:

        • String
        • Number and its subclasses
        • Boolean
        • Date
        • Class
        • Character
        • and Serializable as Base64 encoded stream
        Specified by:
        toString in class Type
        Throws:
        JaloInvalidParameterException
        Since:
        2.10
      • getSuperType

        public AtomicType getSuperType()
        Returns the super type of this type.
      • getSubTypes

        public java.util.Set getSubTypes()
        Returns all subtypes for this type.
      • getJavaClass

        public java.lang.Class getJavaClass()
        Returns the java-class of this type.
      • getXMLDefinition

        public java.lang.String getXMLDefinition()
        Provides the XML definiton to put inside a items.xml
        Specified by:
        getXMLDefinition in class Type
      • getAtomicTypeImpl

        protected AtomicType.AtomicTypeImpl getAtomicTypeImpl()
        Internal access to the persistence layer implementation.
      • isAssignableFrom

        public boolean isAssignableFrom​(Type type)
        Test assignability between atomic types. This type is assignable from another type if its java class is assiganble from the other type's java class.
        Specified by:
        isAssignableFrom in class Type
        Parameters:
        type - the type to be checked.
      • isInstance

        public boolean isInstance​(java.lang.Object o)
        Test whether a object is instance of this atomic type. This is true if the object is instance of this type's java class.
        Specified by:
        isInstance in class Type
        Parameters:
        o - the object to be checked.