Package javax.jcr
Class PropertyType
- java.lang.Object
-
- javax.jcr.PropertyType
-
public final class PropertyType extends java.lang.ObjectThe property types supported by the JCR standard.This interface defines following property types:
STRINGBINARYLONGDOUBLEDECIMALDATEBOOLEANNAMEPATHREFERENCEWEAKREFERENCEURI
-
-
Field Summary
Fields Modifier and Type Field Description static intBINARYBINARYproperties are used to store binary data.static intBOOLEANTheBOOLEANproperty type is used to store boolean values.static intDATETheDATEproperty type is used to store time and date information.static intDECIMALTheDECIMALproperty type is used to store precise decimal numbers.static intDOUBLETheDOUBLEproperty type is used to store floating point numbers.static intLONGTheLONGproperty type is used to store integers.static intNAMEANAMEis a pairing of a namespace and a local name.static intPATHAPATHproperty is an ordered list of path elements.static intREFERENCEAREFERENCEproperty stores the identifier of a referenceable node (one having typemix:referenceable), which must exist within the same workspace or session as theREFERENCEproperty.static intSTRINGTheSTRINGproperty type is used to store strings.static java.lang.StringTYPENAME_BINARYString constant for type name as used in serialization.static java.lang.StringTYPENAME_BOOLEANString constant for type name as used in serialization.static java.lang.StringTYPENAME_DATEString constant for type name as used in serialization.static java.lang.StringTYPENAME_DECIMALString constant for type name as used in serialization.static java.lang.StringTYPENAME_DOUBLEString constant for type name as used in serialization.static java.lang.StringTYPENAME_LONGString constant for type name as used in serialization.static java.lang.StringTYPENAME_NAMEString constant for type name as used in serialization.static java.lang.StringTYPENAME_PATHString constant for type name as used in serialization.static java.lang.StringTYPENAME_REFERENCEString constant for type name as used in serialization.static java.lang.StringTYPENAME_STRINGString constant for type name as used in serialization.static java.lang.StringTYPENAME_UNDEFINEDstatic java.lang.StringTYPENAME_URIString constant for type name as used in serialization.static java.lang.StringTYPENAME_WEAKREFERENCEString constant for type name as used in serialization.static intUNDEFINEDThis 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 intURIAURIproperty is identical toSTRINGproperty except that it only accepts values that conform to the syntax of a URI-reference as defined in RFC 3986.static intWEAKREFERENCEAWEAKREFERENCEproperty stores the identifier of a referenceable node (one having typemix:referenceable).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringnameFromValue(int type)Returns the name of the specifiedtype, as used in serialization.static intvalueFromName(java.lang.String name)Returns the numeric constant value of the type with the specified name.
-
-
-
Field Detail
-
STRING
public static final int STRING
TheSTRINGproperty type is used to store strings. It has the same characteristics as the JavaStringclass.- See Also:
- Constant Field Values
-
BINARY
public static final int BINARY
BINARYproperties are used to store binary data.- See Also:
- Constant Field Values
-
LONG
public static final int LONG
TheLONGproperty type is used to store integers. It has the same characteristics as the Java primitive typelong.- See Also:
- Constant Field Values
-
DOUBLE
public static final int DOUBLE
TheDOUBLEproperty type is used to store floating point numbers. It has the same characteristics as the Java primitive typedouble.- See Also:
- Constant Field Values
-
DATE
public static final int DATE
TheDATEproperty type is used to store time and date information.- See Also:
- Constant Field Values
-
BOOLEAN
public static final int BOOLEAN
TheBOOLEANproperty type is used to store boolean values. It has the same characteristics as the Java primitive typeboolean.- See Also:
- Constant Field Values
-
NAME
public static final int NAME
ANAMEis 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
APATHproperty 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:
- Constant Field Values
-
REFERENCE
public static final int REFERENCE
AREFERENCEproperty 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:
- Constant Field Values
-
WEAKREFERENCE
public static final int WEAKREFERENCE
AWEAKREFERENCEproperty stores the identifier of a referenceable node (one having typemix:referenceable). AWEAKREFERENCEproperty does not enforce referential integrity.- Since:
- JCR 2.0
- See Also:
- Constant Field Values
-
URI
public static final int URI
AURIproperty 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:
- Constant Field Values
-
DECIMAL
public static final int DECIMAL
TheDECIMALproperty 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:
- 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 byProperty.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 specifiedtype, as used in serialization.- Parameters:
type- the property type- Returns:
- the name of the specified
type - Throws:
java.lang.IllegalArgumentException- iftypeis 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- ifnameis not a valid property type name.
-
-