Package javax.jcr

Class PropertyType


  • public final class PropertyType
    extends java.lang.Object
    The property types supported by the JCR standard.

    This interface defines following property types:

    • STRING
    • BINARY
    • LONG
    • DOUBLE
    • DECIMAL
    • DATE
    • BOOLEAN
    • NAME
    • PATH
    • REFERENCE
    • WEAKREFERENCE
    • URI
    .
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int BINARY
      BINARY properties are used to store binary data.
      static int BOOLEAN
      The BOOLEAN property type is used to store boolean values.
      static int DATE
      The DATE property type is used to store time and date information.
      static int DECIMAL
      The DECIMAL property type is used to store precise decimal numbers.
      static int DOUBLE
      The DOUBLE property type is used to store floating point numbers.
      static int LONG
      The LONG property type is used to store integers.
      static int NAME
      A NAME is a pairing of a namespace and a local name.
      static int PATH
      A PATH property is an ordered list of path elements.
      static int REFERENCE
      A REFERENCE property stores the identifier of a referenceable node (one having type mix:referenceable), which must exist within the same workspace or session as the REFERENCE property.
      static int STRING
      The STRING property type is used to store strings.
      static java.lang.String TYPENAME_BINARY
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_BOOLEAN
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_DATE
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_DECIMAL
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_DOUBLE
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_LONG
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_NAME
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_PATH
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_REFERENCE
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_STRING
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_UNDEFINED  
      static java.lang.String TYPENAME_URI
      String constant for type name as used in serialization.
      static java.lang.String TYPENAME_WEAKREFERENCE
      String constant for type name as used in serialization.
      static int UNDEFINED
      This constant can be used within a property definition (see 4.7.5 Property Definitions) to specify that the property in question may be of any type.
      static int URI
      A URI property is identical to STRING property except that it only accepts values that conform to the syntax of a URI-reference as defined in RFC 3986.
      static int WEAKREFERENCE
      A WEAKREFERENCE property stores the identifier of a referenceable node (one having type mix:referenceable).
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String nameFromValue​(int type)
      Returns the name of the specified type, as used in serialization.
      static int valueFromName​(java.lang.String name)
      Returns the numeric constant value of the type with the specified name.
      • Methods inherited from class java.lang.Object

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

      • STRING

        public static final int STRING
        The STRING property type is used to store strings. It has the same characteristics as the Java String class.
        See Also:
        Constant Field Values
      • BINARY

        public static final int BINARY
        BINARY properties are used to store binary data.
        See Also:
        Constant Field Values
      • LONG

        public static final int LONG
        The LONG property type is used to store integers. It has the same characteristics as the Java primitive type long.
        See Also:
        Constant Field Values
      • DOUBLE

        public static final int DOUBLE
        The DOUBLE property type is used to store floating point numbers. It has the same characteristics as the Java primitive type double.
        See Also:
        Constant Field Values
      • DATE

        public static final int DATE
        The DATE property type is used to store time and date information.
        See Also:
        Constant Field Values
      • BOOLEAN

        public static final int BOOLEAN
        The BOOLEAN property type is used to store boolean values. It has the same characteristics as the Java primitive type boolean.
        See Also:
        Constant Field Values
      • NAME

        public static final int NAME
        A NAME is a pairing of a namespace and a local name. When read, the namespace is mapped to the current prefix.
        See Also:
        Constant Field Values
      • PATH

        public static final int PATH
        A PATH property is an ordered list of path elements. A path element is a NAME with an optional index. When read, the NAMEs within the path are mapped to their current prefix. A path may be absolute or relative.
        See Also:
        Constant Field Values
      • REFERENCE

        public static final int REFERENCE
        A REFERENCE property stores the identifier of a referenceable node (one having type mix:referenceable), which must exist within the same workspace or session as the REFERENCE property. A REFERENCE property enforces this referential integrity by preventing the removal of its target node.
        See Also:
        Constant Field Values
      • WEAKREFERENCE

        public static final int WEAKREFERENCE
        A WEAKREFERENCE property stores the identifier of a referenceable node (one having type mix:referenceable). A WEAKREFERENCE property does not enforce referential integrity.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • URI

        public static final int URI
        A URI property is identical to STRING property except that it only accepts values that conform to the syntax of a URI-reference as defined in RFC 3986.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • DECIMAL

        public static final int DECIMAL
        The DECIMAL property type is used to store precise decimal numbers. It has the same characteristics as the Java class java.math.BigDecimal.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • UNDEFINED

        public static final int UNDEFINED
        This constant can be used within a property definition (see 4.7.5 Property Definitions) to specify that the property in question may be of any type. However, it cannot be the actual type of any property instance. For example, it will never be returned by Property.getType() and it cannot be assigned as the type when creating a new property.
        See Also:
        Constant Field Values
      • TYPENAME_STRING

        public static final java.lang.String TYPENAME_STRING
        String constant for type name as used in serialization.
        See Also:
        Constant Field Values
      • TYPENAME_BINARY

        public static final java.lang.String TYPENAME_BINARY
        String constant for type name as used in serialization.
        See Also:
        Constant Field Values
      • TYPENAME_LONG

        public static final java.lang.String TYPENAME_LONG
        String constant for type name as used in serialization.
        See Also:
        Constant Field Values
      • TYPENAME_DOUBLE

        public static final java.lang.String TYPENAME_DOUBLE
        String constant for type name as used in serialization.
        See Also:
        Constant Field Values
      • TYPENAME_DECIMAL

        public static final java.lang.String TYPENAME_DECIMAL
        String constant for type name as used in serialization.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • TYPENAME_DATE

        public static final java.lang.String TYPENAME_DATE
        String constant for type name as used in serialization.
        See Also:
        Constant Field Values
      • TYPENAME_BOOLEAN

        public static final java.lang.String TYPENAME_BOOLEAN
        String constant for type name as used in serialization.
        See Also:
        Constant Field Values
      • TYPENAME_NAME

        public static final java.lang.String TYPENAME_NAME
        String constant for type name as used in serialization.
        See Also:
        Constant Field Values
      • TYPENAME_PATH

        public static final java.lang.String TYPENAME_PATH
        String constant for type name as used in serialization.
        See Also:
        Constant Field Values
      • TYPENAME_REFERENCE

        public static final java.lang.String TYPENAME_REFERENCE
        String constant for type name as used in serialization.
        See Also:
        Constant Field Values
      • TYPENAME_WEAKREFERENCE

        public static final java.lang.String TYPENAME_WEAKREFERENCE
        String constant for type name as used in serialization.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • TYPENAME_URI

        public static final java.lang.String TYPENAME_URI
        String constant for type name as used in serialization.
        Since:
        JCR 2.0
        See Also:
        Constant Field Values
      • TYPENAME_UNDEFINED

        public static final java.lang.String TYPENAME_UNDEFINED
        See Also:
        Constant Field Values
    • Method Detail

      • nameFromValue

        public static java.lang.String nameFromValue​(int type)
        Returns the name of the specified type, as used in serialization.
        Parameters:
        type - the property type
        Returns:
        the name of the specified type
        Throws:
        java.lang.IllegalArgumentException - if type is not a valid property type.
      • valueFromName

        public static int valueFromName​(java.lang.String name)
        Returns the numeric constant value of the type with the specified name.
        Parameters:
        name - the name of the property type.
        Returns:
        the numeric constant value.
        Throws:
        java.lang.IllegalArgumentException - if name is not a valid property type name.