Class PropertyState
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.state.ItemState
-
- org.apache.jackrabbit.jcr2spi.state.PropertyState
-
public class PropertyState extends ItemState
PropertyState
represents the state of aProperty
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.jcr2spi.state.ItemState
ItemState.MergeResult, ItemState.SimpleMergeResult
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PropertyState(PropertyEntry entry, ItemStateFactory isf, QPropertyDefinition definition, ItemDefinitionProvider definitionProvider, QValue[] values, int propertyType)
Create a NEW PropertyStateprotected
PropertyState(PropertyEntry entry, PropertyInfo pInfo, ItemStateFactory isf, ItemDefinitionProvider definitionProvider)
Create an EXISTING PropertyState
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QPropertyDefinition
getDefinition()
Returns thedefinition
defined for this property state.ItemId
getId()
Utility method: Returns the identifier of this item state.int
getType()
Returns the type of the property value(s).QValue
getValue()
Convenience method for single valued property states.QValue[]
getValues()
Returns the value(s) of this property.ItemId
getWorkspaceId()
Utility method: Returns the identifier of this item state.boolean
isMultiValued()
Returns true if this property is multi-valued, otherwise false.boolean
isNode()
Always returns false.ItemState.MergeResult
merge(ItemState another, boolean keepChanges)
IfkeepChanges
is true, this method only compares the existing values with the values from 'another' and returns true, if the underlying persistent state is different to the stored persistent values.boolean
revert()
Revert all transient modifications made to this ItemState.-
Methods inherited from class org.apache.jackrabbit.jcr2spi.state.ItemState
addListener, getHierarchyEntry, getListeners, getName, getParent, getPath, getStatus, invalidate, isValid, removeListener, setStatus
-
-
-
-
Constructor Detail
-
PropertyState
protected PropertyState(PropertyEntry entry, ItemStateFactory isf, QPropertyDefinition definition, ItemDefinitionProvider definitionProvider, QValue[] values, int propertyType) throws ConstraintViolationException, RepositoryException
Create a NEW PropertyState- Parameters:
entry
-isf
-definition
-definitionProvider
-- Throws:
ConstraintViolationException
RepositoryException
-
PropertyState
protected PropertyState(PropertyEntry entry, PropertyInfo pInfo, ItemStateFactory isf, ItemDefinitionProvider definitionProvider)
Create an EXISTING PropertyState- Parameters:
entry
-pInfo
-isf
-definitionProvider
-
-
-
Method Detail
-
isNode
public boolean isNode()
Always returns false.- Specified by:
isNode
in classItemState
- Returns:
- always false
- See Also:
ItemState.isNode()
-
getId
public ItemId getId() throws RepositoryException
Utility method: Returns the identifier of this item state. Shortcut for calling 'getId' on thehierarchy entry
.- Specified by:
getId
in classItemState
- Returns:
- the identifier of this item state..
- Throws:
RepositoryException
- See Also:
ItemState.getId()
-
getWorkspaceId
public ItemId getWorkspaceId() throws RepositoryException
Utility method: Returns the identifier of this item state. Shortcut for calling 'getWorkspaceId' on the NodeEntry or PropertyEntry respectively.- Specified by:
getWorkspaceId
in classItemState
- Returns:
- the identifier of this item state..
- Throws:
RepositoryException
- See Also:
ItemState.getWorkspaceId()
-
merge
public ItemState.MergeResult merge(ItemState another, boolean keepChanges)
IfkeepChanges
is true, this method only compares the existing values with the values from 'another' and returns true, if the underlying persistent state is different to the stored persistent values. Otherwise the transient changes will be discarded.- Specified by:
merge
in classItemState
- Returns:
- a MergeResult instance which represent the result of the merge operation
- See Also:
ItemState.merge(ItemState, boolean)
-
revert
public boolean revert()
Description copied from class:ItemState
Revert all transient modifications made to this ItemState.- Specified by:
revert
in classItemState
- Returns:
- true if
- See Also:
ItemState.revert()
-
getType
public int getType()
Returns the type of the property value(s).- Returns:
- the type of the property value(s).
- See Also:
PropertyType
,for the type required by the property definition. The effective type may differ from the required type if the latter is .
-
isMultiValued
public boolean isMultiValued()
Returns true if this property is multi-valued, otherwise false.- Returns:
- true if this property is multi-valued, otherwise false.
-
getDefinition
public QPropertyDefinition getDefinition() throws RepositoryException
Returns thedefinition
defined for this property state. Note that the definition has been set upon creation of thisPropertyState
.- Returns:
- definition of this state
- Throws:
RepositoryException
- If an error occurs.
-
getValues
public QValue[] getValues()
Returns the value(s) of this property.- Returns:
- the value(s) of this property.
-
getValue
public QValue getValue() throws ValueFormatException
Convenience method for single valued property states.- Returns:
- the value of a single valued property.
- Throws:
ValueFormatException
- ifisMultiValued()
returns true.
-
-