Package javax.jcr
Class PropertyType
java.lang.Object
javax.jcr.PropertyType
The property types supported by the JCR standard.
This interface defines following property types:
STRINGBINARYLONGDOUBLEDECIMALDATEBOOLEANNAMEPATHREFERENCEWEAKREFERENCEURI
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBINARYproperties are used to store binary data.static final intTheBOOLEANproperty type is used to store boolean values.static final intTheDATEproperty type is used to store time and date information.static final intTheDECIMALproperty type is used to store precise decimal numbers.static final intTheDOUBLEproperty type is used to store floating point numbers.static final intTheLONGproperty type is used to store integers.static final intANAMEis a pairing of a namespace and a local name.static final intAPATHproperty is an ordered list of path elements.static final intAREFERENCEproperty stores the identifier of a referenceable node (one having typemix:referenceable), which must exist within the same workspace or session as theREFERENCEproperty.static final intTheSTRINGproperty type is used to store strings.static final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final Stringstatic final StringString constant for type name as used in serialization.static final StringString constant for type name as used in serialization.static final intThis 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 intAURIproperty is identical toSTRINGproperty except that it only accepts values that conform to the syntax of a URI-reference as defined in RFC 3986.static final intAWEAKREFERENCEproperty stores the identifier of a referenceable node (one having typemix:referenceable). -
Method Summary
Modifier and TypeMethodDescriptionstatic StringnameFromValue(int type) Returns the name of the specifiedtype, as used in serialization.static intvalueFromName(String name) Returns the numeric constant value of the type with the specified name.
-
Field Details
-
STRING
public static final int STRINGTheSTRINGproperty type is used to store strings. It has the same characteristics as the JavaStringclass.- See Also:
-
BINARY
public static final int BINARYBINARYproperties are used to store binary data.- See Also:
-
LONG
public static final int LONGTheLONGproperty type is used to store integers. It has the same characteristics as the Java primitive typelong.- See Also:
-
DOUBLE
public static final int DOUBLETheDOUBLEproperty type is used to store floating point numbers. It has the same characteristics as the Java primitive typedouble.- See Also:
-
DATE
public static final int DATETheDATEproperty type is used to store time and date information.- See Also:
-
BOOLEAN
public static final int BOOLEANTheBOOLEANproperty type is used to store boolean values. It has the same characteristics as the Java primitive typeboolean.- See Also:
-
NAME
public static final int NAMEANAMEis 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 PATHAPATHproperty is an ordered list of path elements. A path element is aNAMEwith an optional index. When read, theNAMEs within the path are mapped to their current prefix. A path may be absolute or relative.- See Also:
-
REFERENCE
public static final int REFERENCEAREFERENCEproperty stores the identifier of a referenceable node (one having typemix:referenceable), which must exist within the same workspace or session as theREFERENCEproperty. AREFERENCEproperty enforces this referential integrity by preventing the removal of its target node.- See Also:
-
WEAKREFERENCE
public static final int WEAKREFERENCEAWEAKREFERENCEproperty stores the identifier of a referenceable node (one having typemix:referenceable). AWEAKREFERENCEproperty does not enforce referential integrity.- Since:
- JCR 2.0
- See Also:
-
URI
public static final int URIAURIproperty is identical toSTRINGproperty 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 DECIMALTheDECIMALproperty type is used to store precise decimal numbers. It has the same characteristics as the Java classjava.math.BigDecimal.- Since:
- JCR 2.0
- See Also:
-
UNDEFINED
public static final int UNDEFINEDThis 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 byProperty.getType()and it cannot be assigned as the type when creating a new property.- See Also:
-
TYPENAME_STRING
String constant for type name as used in serialization.- See Also:
-
TYPENAME_BINARY
String constant for type name as used in serialization.- See Also:
-
TYPENAME_LONG
String constant for type name as used in serialization.- See Also:
-
TYPENAME_DOUBLE
String constant for type name as used in serialization.- See Also:
-
TYPENAME_DECIMAL
String constant for type name as used in serialization.- Since:
- JCR 2.0
- See Also:
-
TYPENAME_DATE
String constant for type name as used in serialization.- See Also:
-
TYPENAME_BOOLEAN
String constant for type name as used in serialization.- See Also:
-
TYPENAME_NAME
String constant for type name as used in serialization.- See Also:
-
TYPENAME_PATH
String constant for type name as used in serialization.- See Also:
-
TYPENAME_REFERENCE
String constant for type name as used in serialization.- See Also:
-
TYPENAME_WEAKREFERENCE
String constant for type name as used in serialization.- Since:
- JCR 2.0
- See Also:
-
TYPENAME_URI
String constant for type name as used in serialization.- Since:
- JCR 2.0
- See Also:
-
TYPENAME_UNDEFINED
- See Also:
-
-
Method Details
-
nameFromValue
Returns the name of the specifiedtype, as used in serialization.- Parameters:
type- the property type- Returns:
- the name of the specified
type - Throws:
IllegalArgumentException- iftypeis not a valid property type.
-
valueFromName
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- ifnameis not a valid property type name.
-