Package javax.jcr

Class PropertyType

java.lang.Object
javax.jcr.PropertyType

public final class PropertyType extends 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 final int
    BINARY properties are used to store binary data.
    static final int
    The BOOLEAN property type is used to store boolean values.
    static final int
    The DATE property type is used to store time and date information.
    static final int
    The DECIMAL property type is used to store precise decimal numbers.
    static final int
    The DOUBLE property type is used to store floating point numbers.
    static final int
    The LONG property type is used to store integers.
    static final int
    A NAME is a pairing of a namespace and a local name.
    static final int
    A PATH property is an ordered list of path elements.
    static final int
    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 final int
    The STRING property type is used to store strings.
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final String
     
    static final String
    String constant for type name as used in serialization.
    static final String
    String constant for type name as used in serialization.
    static final int
    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 final int
    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 final int
    A WEAKREFERENCE property stores the identifier of a referenceable node (one having type mix:referenceable).
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    nameFromValue(int type)
    Returns the name of the specified type, as used in serialization.
    static int
    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 Details

    • 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:
    • BINARY

      public static final int BINARY
      BINARY properties are used to store binary data.
      See Also:
    • 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:
    • 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:
    • DATE

      public static final int DATE
      The DATE property type is used to store time and date information.
      See Also:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • TYPENAME_STRING

      public static final String TYPENAME_STRING
      String constant for type name as used in serialization.
      See Also:
    • TYPENAME_BINARY

      public static final String TYPENAME_BINARY
      String constant for type name as used in serialization.
      See Also:
    • TYPENAME_LONG

      public static final String TYPENAME_LONG
      String constant for type name as used in serialization.
      See Also:
    • TYPENAME_DOUBLE

      public static final String TYPENAME_DOUBLE
      String constant for type name as used in serialization.
      See Also:
    • TYPENAME_DECIMAL

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

      public static final String TYPENAME_DATE
      String constant for type name as used in serialization.
      See Also:
    • TYPENAME_BOOLEAN

      public static final String TYPENAME_BOOLEAN
      String constant for type name as used in serialization.
      See Also:
    • TYPENAME_NAME

      public static final String TYPENAME_NAME
      String constant for type name as used in serialization.
      See Also:
    • TYPENAME_PATH

      public static final String TYPENAME_PATH
      String constant for type name as used in serialization.
      See Also:
    • TYPENAME_REFERENCE

      public static final String TYPENAME_REFERENCE
      String constant for type name as used in serialization.
      See Also:
    • TYPENAME_WEAKREFERENCE

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

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

      public static final String TYPENAME_UNDEFINED
      See Also:
  • Method Details

    • nameFromValue

      public static 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:
      IllegalArgumentException - if type is not a valid property type.
    • valueFromName

      public static int valueFromName(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:
      IllegalArgumentException - if name is not a valid property type name.