Interface Property
- All Superinterfaces:
Item
- All Known Implementing Classes:
AbstractProperty
Property object represents the smallest granularity of content
storage. It has a single parent node and no children. A property consists of
a name and a value, or in the case of multi-value properties, a set of values
all of the same type. See Value.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA constant for the property namejcr:activity(in expanded form), declared in node typesmix:versionableandnt:version.static final StringA constant for the property namejcr:autoCreated(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.static final StringA constant for the property namejcr:baseVersion(in expanded form), declared in node typemix:versionable.static final StringA constant for the property namejcr:childVersionHistory(in expanded form), declared in node typent:versionedChild.static final StringA constant for the property namejcr:configuration(in expanded form), declared in node typemix:versionable.static final StringA constant for the property namejcr:content(in expanded form), declared in node typent:linkedFile.static final StringA constant for the property namejcr:copiedFrom(in expanded form), declared in node typent:version.static final StringA constant for the property namejcr:created(in expanded form), declared in node typesmix:createdandnt:version.static final StringA constant for the property namejcr:createdBy(in expanded form), declared in node typemix:created.static final StringA constant for the property namejcr:currentLifecycleState(in expanded form), declared in node typemix:lifecycle.static final StringA constant for the property namejcr:data(in expanded form), declared in node typent:resource.static final StringA constant for the property namejcr:defaultPrimaryType(in expanded form), declared in node typent:childNodeDefinition.static final StringA constant for the property namejcr:defaultValues(in expanded form), declared in node typent:propertyDefinition.static final StringA constant for the property namejcr:description(in expanded form), declared in node typemix:title.static final StringA constant for the property namejcr:encoding(in expanded form), declared in node typemix:mimeType.static final StringA constant for the property namejcr:frozenMixinTypes(in expanded form), declared in node typent:frozenNode.static final StringA constant for the property namejcr:frozenPrimaryType(in expanded form), declared in node typent:frozenNode.static final StringA constant for the property namejcr:frozenUuid(in expanded form), declared in node typent:frozenNode.static final StringA constant for the property namejcr:hasOrderableChildNodes(in expanded form), declared in node typent:nodeType.static final StringA constant for the property namejcr:host(in expanded form), declared in node typent:address.static final StringA constant for the property namejcr:id(in expanded form), declared in node typent:address.static final StringA constant for the property namejcr:isAbstract(in expanded form), declared in node typent:nodeType.static final StringA constant for the property namejcr:isCheckedOut(in expanded form), declared in node typemix:simpleVersionable.static final StringA constant for the property namejcr:isMixin(in expanded form), declared in node typent:nodeType.static final StringA constant for the property namejcr:language(in expanded form), declared in node typesmix:languageandnt:query.static final StringA constant for the property namejcr:lastModified(in expanded form), declared in node typemix:lastModified.static final StringA constant for the property namejcr:lastModifiedBy(in expanded form), declared in node typemix:lastModified.static final StringA constant for the property namejcr:lifecyclePolicy(in expanded form), declared in node typemix:lifecycle.static final StringA constant for the property namejcr:lockIsDeep(in expanded form), declared in node typemix:lockable.static final StringA constant for the property namejcr:lockOwner(in expanded form), declared in node typemix:lockable.static final StringA constant for the property namejcr:mandatory(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.static final StringA constant for the property namejcr:mergeFailed(in expanded form), declared in node typemix:versionable.static final StringA constant for the property namejcr:mimeType(in expanded form), declared in node typemix:mimeType.static final StringA constant for the property namejcr:mixinTypes(in expanded form), declared in node typent:base.static final StringA constant for the property namejcr:multiple(in expanded form), declared in node typent:propertyDefinition.static final StringA constant for the property namejcr:name(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.static final StringA constant for the property namejcr:nodeTypeName(in expanded form), declared in node typent:nodeType.static final StringA constant for the property namejcr:onParentVersion(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.static final StringA constant for the property namejcr:path(in expanded form), declared in node typent:address.static final StringA constant for the property namejcr:port(in expanded form), declared in node typent:address.static final StringA constant for the property namejcr:predecessors(in expanded form), declared in node typesmix:versionableandnt:version.static final StringA constant for the property namejcr:primaryItemName(in expanded form), declared in node typent:nodeType.static final StringA constant for the property namejcr:primaryType(in expanded form), declared in node typent:base.static final StringA constant for the property namejcr:protected(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.static final StringA constant for the property namejcr:protocol(in expanded form), declared in node typent:address.static final StringA constant for the property namejcr:repository(in expanded form), declared in node typent:address.static final StringA constant for the property namejcr:requiredPrimaryTypes(in expanded form), declared in node typent:childNodeDefinition.static final StringA constant for the property namejcr:requiredType(in expanded form), declared in node typent:propertyDefinition.static final StringA constant for the property namejcr:root(in expanded form), declared in node typent:configuration.static final StringA constant for the property namejcr:sameNameSiblings(in expanded form), declared in node typent:childNodeDefinition.static final StringA constant for the property namejcr:statement(in expanded form), declared in node typent:query.static final StringA constant for the property namejcr:successors(in expanded form), declared in node typent:versione.static final StringA constant for the property namejcr:supertypes(in expanded form), declared in node typent:nodeType.static final StringA constant for the property namejcr:title(in expanded form), declared in node typesmix:titleandnt:activity.static final StringA constant for the property namejcr:uuid(in expanded form), declared in node typemix:referenceable.static final StringA constant for the property namejcr:valueConstraints(in expanded form), declared in node typent:propertyDefinition.static final StringA constant for the property namejcr:versionHistory(in expanded form), declared in node typemix:versionable.static final StringA constant for the property namejcr:versionableUuid(in expanded form), declared in node typent:version.static final StringA constant for the property namejcr:workspace(in expanded form), declared in node typent:address. -
Method Summary
Modifier and TypeMethodDescriptionReturns aBinaryrepresentation of the value of this property.booleanReturns abooleanrepresentation of the value of this property.getDate()Returns aCalendarrepresentation of the value of this property.Returns aBigDecimalrepresentation of the value of this property.Returns the property definition that applies to this property.doubleReturns adoublerepresentation of the value of this property.longReturns the length of the value of this property.long[]Returns an array holding the lengths of the values of this (multi-value) property in bytes where each is individually calculated as described ingetLength().longgetLong()Returns alongrepresentation of the value of this property.getNode()If this property is of typeREFERENCE,WEAKREFERENCEorPATH(or convertible to one of these types) this method returns theNodeto which this property refers.If this property is of typePATH(or convertible to this type) this method returns thePropertyto which this property refers.Deprecated.Returns aStringrepresentation of the value of this property.intgetType()Returns the type of thisProperty.getValue()Returns the value of this property as aValueobject.Value[]Returns an array of all the values of this property.booleanReturnstrueif this property is multi-valued andfalseif this property is single-valued.voidsetValue(boolean value) Sets the value of this property tovalue.voidsetValue(double value) Sets the value of this property tovalue.voidsetValue(long value) Sets the value of this property tovalue.voidsetValue(InputStream value) Deprecated.As of JCR 2.0,setValue(Binary)should be used instead.voidSets the value of this property tovalue.voidSets the value of this property to thevaluesarray.voidsetValue(BigDecimal value) Sets the value of this property tovalue.voidSets the value of this property tovalue.voidSets the value of this property tovalue.voidSets thisREFERENCEorWEAKREFERNCEproperty to refer to the specified node.voidSets the value of this property tovalue.voidSets the value of this property to thevaluesarray.Methods inherited from interface javax.jcr.Item
accept, getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, isSame, refresh, remove, save
-
Field Details
-
JCR_PRIMARY_TYPE
A constant for the property namejcr:primaryType(in expanded form), declared in node typent:base.- Since:
- JCR 2.0
- See Also:
-
JCR_MIXIN_TYPES
A constant for the property namejcr:mixinTypes(in expanded form), declared in node typent:base.- Since:
- JCR 2.0
- See Also:
-
JCR_CONTENT
A constant for the property namejcr:content(in expanded form), declared in node typent:linkedFile. Note,jcr:contentis also the name of a child node declared innt:file.- Since:
- JCR 2.0
- See Also:
-
JCR_DATA
A constant for the property namejcr:data(in expanded form), declared in node typent:resource.- Since:
- JCR 2.0
- See Also:
-
JCR_PROTOCOL
A constant for the property namejcr:protocol(in expanded form), declared in node typent:address.- Since:
- JCR 2.0
- See Also:
-
JCR_HOST
A constant for the property namejcr:host(in expanded form), declared in node typent:address.- Since:
- JCR 2.0
- See Also:
-
JCR_PORT
A constant for the property namejcr:port(in expanded form), declared in node typent:address.- Since:
- JCR 2.0
- See Also:
-
JCR_REPOSITORY
A constant for the property namejcr:repository(in expanded form), declared in node typent:address.- Since:
- JCR 2.0
- See Also:
-
JCR_WORKSPACE
A constant for the property namejcr:workspace(in expanded form), declared in node typent:address.- Since:
- JCR 2.0
- See Also:
-
JCR_PATH
A constant for the property namejcr:path(in expanded form), declared in node typent:address.- Since:
- JCR 2.0
- See Also:
-
JCR_ID
A constant for the property namejcr:id(in expanded form), declared in node typent:address.- Since:
- JCR 2.0
- See Also:
-
JCR_UUID
A constant for the property namejcr:uuid(in expanded form), declared in node typemix:referenceable.- Since:
- JCR 2.0
- See Also:
-
JCR_TITLE
A constant for the property namejcr:title(in expanded form), declared in node typesmix:titleandnt:activity.- Since:
- JCR 2.0
- See Also:
-
JCR_DESCRIPTION
A constant for the property namejcr:description(in expanded form), declared in node typemix:title.- Since:
- JCR 2.0
- See Also:
-
JCR_CREATED
A constant for the property namejcr:created(in expanded form), declared in node typesmix:createdandnt:version.- Since:
- JCR 2.0
- See Also:
-
JCR_CREATED_BY
A constant for the property namejcr:createdBy(in expanded form), declared in node typemix:created.- Since:
- JCR 2.0
- See Also:
-
JCR_LAST_MODIFIED
A constant for the property namejcr:lastModified(in expanded form), declared in node typemix:lastModified.- Since:
- JCR 2.0
- See Also:
-
JCR_LAST_MODIFIED_BY
A constant for the property namejcr:lastModifiedBy(in expanded form), declared in node typemix:lastModified.- Since:
- JCR 2.0
- See Also:
-
JCR_LANGUAGE
A constant for the property namejcr:language(in expanded form), declared in node typesmix:languageandnt:query.- Since:
- JCR 2.0
- See Also:
-
JCR_MIMETYPE
A constant for the property namejcr:mimeType(in expanded form), declared in node typemix:mimeType.- Since:
- JCR 2.0
- See Also:
-
JCR_ENCODING
A constant for the property namejcr:encoding(in expanded form), declared in node typemix:mimeType.- Since:
- JCR 2.0
- See Also:
-
JCR_NODE_TYPE_NAME
A constant for the property namejcr:nodeTypeName(in expanded form), declared in node typent:nodeType.- Since:
- JCR 2.0
- See Also:
-
JCR_SUPERTYPES
A constant for the property namejcr:supertypes(in expanded form), declared in node typent:nodeType.- Since:
- JCR 2.0
- See Also:
-
JCR_IS_ABSTRACT
A constant for the property namejcr:isAbstract(in expanded form), declared in node typent:nodeType.- Since:
- JCR 2.0
- See Also:
-
JCR_IS_MIXIN
A constant for the property namejcr:isMixin(in expanded form), declared in node typent:nodeType.- Since:
- JCR 2.0
- See Also:
-
JCR_HAS_ORDERABLE_CHILD_NODES
A constant for the property namejcr:hasOrderableChildNodes(in expanded form), declared in node typent:nodeType.- Since:
- JCR 2.0
- See Also:
-
JCR_PRIMARY_ITEM_NAME
A constant for the property namejcr:primaryItemName(in expanded form), declared in node typent:nodeType.- Since:
- JCR 2.0
- See Also:
-
JCR_NAME
A constant for the property namejcr:name(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_AUTOCREATED
A constant for the property namejcr:autoCreated(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_MANDATORY
A constant for the property namejcr:mandatory(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_PROTECTED
A constant for the property namejcr:protected(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_ON_PARENT_VERSION
A constant for the property namejcr:onParentVersion(in expanded form), declared in node typesnt:propertyDefinitionandnt:childNodeDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_REQUIRED_TYPE
A constant for the property namejcr:requiredType(in expanded form), declared in node typent:propertyDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_VALUE_CONSTRAINTS
A constant for the property namejcr:valueConstraints(in expanded form), declared in node typent:propertyDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_DEFAULT_VALUES
A constant for the property namejcr:defaultValues(in expanded form), declared in node typent:propertyDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_MULTIPLE
A constant for the property namejcr:multiple(in expanded form), declared in node typent:propertyDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_REQUIRED_PRIMARY_TYPES
A constant for the property namejcr:requiredPrimaryTypes(in expanded form), declared in node typent:childNodeDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_DEFAULT_PRIMARY_TYPE
A constant for the property namejcr:defaultPrimaryType(in expanded form), declared in node typent:childNodeDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_SAME_NAME_SIBLINGS
A constant for the property namejcr:sameNameSiblings(in expanded form), declared in node typent:childNodeDefinition.- Since:
- JCR 2.0
- See Also:
-
JCR_LOCK_OWNER
A constant for the property namejcr:lockOwner(in expanded form), declared in node typemix:lockable.- Since:
- JCR 2.0
- See Also:
-
JCR_LOCK_IS_DEEP
A constant for the property namejcr:lockIsDeep(in expanded form), declared in node typemix:lockable.- Since:
- JCR 2.0
- See Also:
-
JCR_LIFECYCLE_POLICY
A constant for the property namejcr:lifecyclePolicy(in expanded form), declared in node typemix:lifecycle.- Since:
- JCR 2.0
- See Also:
-
JCR_CURRENT_LIFECYCLE_STATE
A constant for the property namejcr:currentLifecycleState(in expanded form), declared in node typemix:lifecycle.- Since:
- JCR 2.0
- See Also:
-
JCR_IS_CHECKED_OUT
A constant for the property namejcr:isCheckedOut(in expanded form), declared in node typemix:simpleVersionable.- Since:
- JCR 2.0
- See Also:
-
JCR_FROZEN_PRIMARY_TYPE
A constant for the property namejcr:frozenPrimaryType(in expanded form), declared in node typent:frozenNode.- Since:
- JCR 2.0
- See Also:
-
JCR_FROZEN_MIXIN_TYPES
A constant for the property namejcr:frozenMixinTypes(in expanded form), declared in node typent:frozenNode.- Since:
- JCR 2.0
- See Also:
-
JCR_FROZEN_UUID
A constant for the property namejcr:frozenUuid(in expanded form), declared in node typent:frozenNode.- Since:
- JCR 2.0
- See Also:
-
JCR_VERSION_HISTORY
A constant for the property namejcr:versionHistory(in expanded form), declared in node typemix:versionable.- Since:
- JCR 2.0
- See Also:
-
JCR_BASE_VERSION
A constant for the property namejcr:baseVersion(in expanded form), declared in node typemix:versionable.- Since:
- JCR 2.0
- See Also:
-
JCR_PREDECESSORS
A constant for the property namejcr:predecessors(in expanded form), declared in node typesmix:versionableandnt:version.- Since:
- JCR 2.0
- See Also:
-
JCR_MERGE_FAILED
A constant for the property namejcr:mergeFailed(in expanded form), declared in node typemix:versionable.- Since:
- JCR 2.0
- See Also:
-
JCR_ACTIVITY
A constant for the property namejcr:activity(in expanded form), declared in node typesmix:versionableandnt:version.- Since:
- JCR 2.0
- See Also:
-
JCR_CONFIGURATION
A constant for the property namejcr:configuration(in expanded form), declared in node typemix:versionable.- Since:
- JCR 2.0
- See Also:
-
JCR_VERSIONABLE_UUID
A constant for the property namejcr:versionableUuid(in expanded form), declared in node typent:version.- Since:
- JCR 2.0
- See Also:
-
JCR_COPIED_FROM
A constant for the property namejcr:copiedFrom(in expanded form), declared in node typent:version.- Since:
- JCR 2.0
- See Also:
-
JCR_SUCCESSORS
A constant for the property namejcr:successors(in expanded form), declared in node typent:versione.- Since:
- JCR 2.0
- See Also:
-
JCR_CHILD_VERSION_HISTORY
A constant for the property namejcr:childVersionHistory(in expanded form), declared in node typent:versionedChild.- Since:
- JCR 2.0
- See Also:
-
JCR_ROOT
A constant for the property namejcr:root(in expanded form), declared in node typent:configuration.- Since:
- JCR 2.0
- See Also:
-
JCR_STATEMENT
A constant for the property namejcr:statement(in expanded form), declared in node typent:query.- Since:
- JCR 2.0
- See Also:
-
-
Method Details
-
setValue
void setValue(Value value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property tovalue. If this property's property type is not constrained by the node type of its parent node, then the property type is changed to that of the suppliedvalue. If the property type is constrained, then a best-effort conversion is attempted.This method is a session-write and therefore requires a
saveto dispatch the change.A
ConstraintViolationExceptionwill be thrown either immediately, on dispatch, or on persist, if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.A
VersionExceptionwill be thrown either immediately, on dispatch, or on persist, if this property belongs to a node that is versionable and checked-in or is non-versionable but whose nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.A
LockExceptionwill be thrown either immediately, on dispatch, or on persist, if a lock prevents the setting of the value. Implementations may differ on when this validation is performed.- Parameters:
value- The new value to set the property to.- Throws:
ValueFormatException- if the type or format of the specified value is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
setValue
void setValue(Value[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property to thevaluesarray. If this property's property type is not constrained by the node type of its parent node, then the property type may be changed. If the property type is constrained, then a best-effort conversion is attempted, according to an implemention-dependent definition of "best effort". The change will be persisted (if valid) onsave.A
ConstraintViolationExceptionwill be thrown either immediately, on dispatch, or on persist, if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.A
VersionExceptionwill be thrown either immediately, on dispatch, or on persist, if this property belongs to a node that is read-only due to a checked-in node. Implementations may differ on when this validation is performed.A
LockExceptionwill be thrown either immediately, on dispatch, or on persist, if a lock prevents the setting of the value. Implementations may differ on when this validation is performed.- Parameters:
values- The new values to set the property to.- Throws:
ValueFormatException- if the type or format of the specified values is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
setValue
void setValue(String value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property tovalue. Same asexcept that the value is specified as asetValue(Value value)String.- Parameters:
value- The new value to set the property to.- Throws:
ValueFormatException- if the type or format of the specified values is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
setValue
void setValue(String[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property to thevaluesarray. Same asexcept that the values are specified as asetValue(Value[] values)String[].- Parameters:
values- The new values to set the property to.- Throws:
ValueFormatException- if the type or format of one or more of the specified values is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
setValue
void setValue(InputStream value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Deprecated.As of JCR 2.0,setValue(Binary)should be used instead.Sets the value of this property tovalue. Same asexcept that the value is specified as ansetValue(Value value)InputStream.The passed stream is closed before this method returns either normally or because of an exception.
- Parameters:
value- The new value to set the property to.- Throws:
ValueFormatException- if the type or format of the specified value is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
setValue
void setValue(Binary value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property tovalue. Same asexcept that the value is specified as asetValue(Value value)Binary.- Parameters:
value- The new value to set the property to.- Throws:
ValueFormatException- if the type or format of the specified value is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.- Since:
- JCR 2.0
-
setValue
void setValue(long value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property tovalue. Same asexcept that the value is specified as asetValue(Value value)long.- Parameters:
value- The new value to set the property to.- Throws:
ValueFormatException- if the type or format of the specified value is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
setValue
void setValue(double value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property tovalue. Same asexcept that the value is specified as asetValue(Value value)double.- Parameters:
value- The new value to set the property to.- Throws:
ValueFormatException- if the type or format of the specified value is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
setValue
void setValue(BigDecimal value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property tovalue. Same asexcept that the value is specified as asetValue(Value value)BigDecimal.- Parameters:
value- The new value to set the property to.- Throws:
ValueFormatException- if the type or format of the specified value is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.- Since:
- JCR 2.0
-
setValue
void setValue(Calendar value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property tovalue. Same asexcept that the value is specified as asetValue(Value value)Calendar.- Parameters:
value- The new value to set the property to.- Throws:
ValueFormatException- if the type or format of the specified value is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
setValue
void setValue(boolean value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets the value of this property tovalue. Same asexcept that the value is specified as asetValue(Value value)boolean.- Parameters:
value- The new value to set the property to.- Throws:
ValueFormatException- if the type or format of the specified value is incompatible with the type of this property.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
setValue
void setValue(Node value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException Sets thisREFERENCEorWEAKREFERNCEproperty to refer to the specified node.- Parameters:
value- The node to which this property will refer.- Throws:
ValueFormatException- if the type or format of the specified value is incompatible with the type of this property the specified node is not referenceable.VersionException- if this property belongs to a node that is read-only due to a checked-in node and this implementation performs this validation immediately.LockException- if a lock prevents the setting of the value and this implementation performs this validation immediately.ConstraintViolationException- if the change would violate a node-type or other constraint and this implementation performs this validation immediately.RepositoryException- if another error occurs.
-
getValue
Returns the value of this property as aValueobject.The object returned is a copy of the stored value and is immutable.
- Returns:
- the
Value. - Throws:
ValueFormatException- if the property is multi-valued.RepositoryException- if another error occurs.
-
getValues
Returns an array of all the values of this property. Used to access multi-value properties. The array returned is a copy of the stored values, so changes to it are not reflected in internal storage.- Returns:
- a
Valuearray. - Throws:
ValueFormatException- if the property is single-valued.RepositoryException- if another error occurs.
-
getString
Returns aStringrepresentation of the value of this property. A shortcut forProperty.getValue().getString().- Returns:
- A string representation of the value of this property.
- Throws:
ValueFormatException- if conversion to aStringis not possible or if the property is multi-valued.RepositoryException- if another error occurs.- See Also:
-
getStream
Deprecated.As of JCR 2.0,getBinary()should be used instead.Returns anInputStreamrepresentation of the value of this property. A shortcut forProperty.getValue().getStream().It is the responsibility of the caller to close the returned InputStream.
- Returns:
- A stream representation of the value of this property.
- Throws:
ValueFormatException- if the property is multi-valued.RepositoryException- if another error occurs- See Also:
-
getBinary
Returns aBinaryrepresentation of the value of this property. A shortcut forProperty.getValue().getBinary().- Returns:
- A
Binaryrepresentation of the value of this property. - Throws:
ValueFormatException- if the property is multi-valued.RepositoryException- if another error occurs.- Since:
- JCR 2.0
- See Also:
-
getLong
Returns alongrepresentation of the value of this property. A shortcut forProperty.getValue().getLong().- Returns:
- A
longrepresentation of the value of this property. - Throws:
ValueFormatException- if conversion to alongis not possible or if the property is multi-valued.RepositoryException- if another error occurs.- See Also:
-
getDouble
Returns adoublerepresentation of the value of this property. A shortcut forProperty.getValue().getDouble().- Returns:
- A
doublerepresentation of the value of this property. - Throws:
ValueFormatException- if conversion to adoubleis not possible or if the property is multi-valued.RepositoryException- if another error occurs.- See Also:
-
getDecimal
Returns aBigDecimalrepresentation of the value of this property. A shortcut forProperty.getValue().getDecimal().- Returns:
- A
BigDecimalrepresentation of the value of this property. - Throws:
ValueFormatException- if conversion to aBigDecimalis not possible or if the property is multi-valued.RepositoryException- if another error occurs- Since:
- JCR 2.0
- See Also:
-
getDate
Returns aCalendarrepresentation of the value of this property. A shortcut forProperty.getValue().getDate().- Returns:
- A
Calendarrepresentation of the value of this property. - Throws:
ValueFormatException- if conversion to a string is not possible or if the property is multi-valued.RepositoryException- if another error occurs.- See Also:
-
getBoolean
Returns abooleanrepresentation of the value of this property. A shortcut forProperty.getValue().getBoolean().- Returns:
- A
booleanrepresentation of the value of this property. - Throws:
ValueFormatException- if conversion to abooleanis not possible or if the property is multi-valued.RepositoryException- if another error occurs.- See Also:
-
getNode
If this property is of typeREFERENCE,WEAKREFERENCEorPATH(or convertible to one of these types) this method returns theNodeto which this property refers.If this property is of type
PATHand it contains a relative path, it is interpreted relative to the parent node of this property. For example "." refers to the parent node itself, ".." to the parent of the parent node and "foo" to a sibling node of this property.- Returns:
- the referenced Node
- Throws:
ValueFormatException- if this property cannot be converted to a referring type (REFERENCE,WEAKREFERENCEorPATH), if the property is multi-valued or if this property is a referring type but is currently part of the frozen state of a version in version storage.ItemNotFoundException- If this property is of typePATHorWEAKREFERENCEand no target node accessible by the currentSessionexists in this workspace. Note that this applies even if the property is aPATHSand a property exists at the specified location. To dereference to a target property (as opposed to a target node), the methodProperty.getPropertyis used.RepositoryException- if another error occurs.
-
getProperty
If this property is of typePATH(or convertible to this type) this method returns thePropertyto which this property refers.If this property contains a relative path, it is interpreted relative to the parent node of this property. Therefore, when resolving such a relative path, the segment "
." refers to the parent node itself, ".." to the parent of the parent node and "foo" to a sibling property of this property or this property itself.For example, if this property is located at
/a/b/cand it has a value of "../d" then this method will return the property at/a/dif such exists.If this property is multi-valued, this method throws a
ValueFormatException.If this property cannot be converted to a
PATHthen aValueFormatExceptionis thrown.If this property is currently part of the frozen state of a version in version storage, this method will throw a
ValueFormatException.- Returns:
- the referenced property
- Throws:
ValueFormatException- if this property cannot be converted to aPATH, if the property is multi-valued or if this property is a referring type but is currently part of the frozen state of a version in version storage.ItemNotFoundException- If no property accessible by the currentSessionexists in this workspace at the specified path. Note that this applies even if a node exists at the specified location. To dereference to a target node, the methodProperty.getNodeis used.RepositoryException- if another error occurs.- Since:
- JCR 2.0
-
getLength
Returns the length of the value of this property.For a
BINARYproperty,getLengthreturns the number of bytes. For other property types,getLengthreturns the same value that would be returned by callingString.length()on the value when it has been converted to aSTRINGaccording to standard JCR property type conversion.Returns -1 if the implementation cannot determine the length.
- Returns:
- an
long. - Throws:
ValueFormatException- if this property is multi-valued.RepositoryException- if another error occurs.
-
getLengths
Returns an array holding the lengths of the values of this (multi-value) property in bytes where each is individually calculated as described ingetLength().Returns a
-1in the appropriate position if the implementation cannot determine the length of a value.- Returns:
- an array of lengths
- Throws:
ValueFormatException- if this property is single-valued.RepositoryException- if another error occurs.
-
getDefinition
Returns the property definition that applies to this property. In some cases there may appear to be more than one definition that could apply to this node. However, it is assumed that upon creation or change of this property, a single particular definition is chosen by the implementation. It is that definition that this method returns. How this governing definition is selected upon property creation or change from among others which may have been applicable is an implementation issue and is not covered by this specification.- Returns:
- a
PropertyDefinitionobject. - Throws:
RepositoryException- if an error occurs.- See Also:
-
getType
Returns the type of thisProperty. One of:PropertyType.STRINGPropertyType.BINARYPropertyType.DATEPropertyType.DOUBLEPropertyType.LONGPropertyType.BOOLEANPropertyType.NAMEPropertyType.PATHPropertyType.REFERENCEPropertyType.WEAKREFERENCEPropertyType.URI
p, the type returned byp.getType()will differ from the type returned byp.getDefinition.getRequiredType()only in the case where the latter returnsUNDEFINED. The type of a property instance is neverUNDEFINED(it must always have some actual type).- Returns:
- an int
- Throws:
RepositoryException- if an error occurs
-
isMultiple
Returnstrueif this property is multi-valued andfalseif this property is single-valued.- Returns:
trueif this property is multi-valued;falseotherwise.- Throws:
RepositoryException- if an error occurs.
-
getBinary()should be used instead.