Package org.apache.jackrabbit.core.state
Class PropertyState
- java.lang.Object
-
- org.apache.jackrabbit.core.state.ItemState
-
- org.apache.jackrabbit.core.state.PropertyState
-
- Direct Known Subclasses:
VirtualPropertyState
public class PropertyState extends ItemState
PropertyState
represents the state of aProperty
.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.core.state.ItemState
overlayedState, status, STATUS_EXISTING, STATUS_EXISTING_MODIFIED, STATUS_EXISTING_REMOVED, STATUS_NEW, STATUS_STALE_DESTROYED, STATUS_UNDEFINED
-
-
Constructor Summary
Constructors Constructor Description PropertyState(PropertyId id, int initialStatus, boolean isTransient)
Create a newPropertyState
PropertyState(PropertyState overlayedState, int initialStatus, boolean isTransient)
Constructs a new property state that is initially connected to an overlayed state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
calculateMemoryFootprint()
Returns an estimate of the memory size of this property state.void
copy(ItemState state, boolean syncModCount)
Copy state information from another state into this stateItemId
getId()
Returns the identifier of this item.Name
getName()
Returns the name of this property.NodeId
getParentId()
Returns the NodeId of the parentNodeState
ornull
if either this item state represents the root node or this item state is 'free floating', i.e.PropertyId
getPropertyId()
Returns the identifier of this property.int
getType()
Returns the type of this property.InternalValue[]
getValues()
Returns the value(s) of this property.boolean
isMultiValued()
Returns true if this property is multi-valued, otherwise false.boolean
isNode()
Determines if this item state represents a node.void
setMultiValued(boolean multiValued)
Sets the flag indicating whether this property is multi-valued.void
setType(int type)
Sets the type of this property.void
setValues(InternalValue[] values)
Sets the value(s) of this property.-
Methods inherited from class org.apache.jackrabbit.core.state.ItemState
connect, discard, disconnect, getContainer, getModCount, getOverlayedState, getStatus, hasOverlayedState, isConnected, isStale, isTransient, notifyStateCreated, notifyStateDestroyed, notifyStateDiscarded, notifyStateUpdated, reconnect, setContainer, setModCount, setStatus
-
-
-
-
Constructor Detail
-
PropertyState
public PropertyState(PropertyState overlayedState, int initialStatus, boolean isTransient)
Constructs a new property state that is initially connected to an overlayed state.- Parameters:
overlayedState
- the backing property state being overlayedinitialStatus
- the initial status of the property state objectisTransient
- flag indicating whether this state is transient or not
-
PropertyState
public PropertyState(PropertyId id, int initialStatus, boolean isTransient)
Create a newPropertyState
- Parameters:
id
- id of the propertyinitialStatus
- the initial status of the property state objectisTransient
- flag indicating whether this state is transient or not
-
-
Method Detail
-
copy
public void copy(ItemState state, boolean syncModCount)
Copy state information from another state into this state
-
isNode
public boolean isNode()
Determines if this item state represents a node.- Specified by:
isNode
in classItemState
- Returns:
- always false
- See Also:
ItemState.isNode()
-
getId
public ItemId getId()
Returns the identifier of this item.
-
getPropertyId
public PropertyId getPropertyId()
Returns the identifier of this property.- Returns:
- the id of this property.
-
getParentId
public NodeId getParentId()
Returns the NodeId of the parentNodeState
ornull
if either this item state represents the root node or this item state is 'free floating', i.e. not attached to the repository's hierarchy.- Specified by:
getParentId
in classItemState
- Returns:
- the parent
NodeState
's Id
-
getName
public Name getName()
Returns the name of this property.- Returns:
- the name of this property.
-
setType
public void setType(int type)
Sets the type of this property.- Parameters:
type
- the type to be set- See Also:
PropertyType
-
setMultiValued
public void setMultiValued(boolean multiValued)
Sets the flag indicating whether this property is multi-valued.- Parameters:
multiValued
- flag indicating whether this property is multi-valued
-
getType
public int getType()
Returns the type of this property.- Returns:
- the type of this property.
- See Also:
PropertyType
-
isMultiValued
public boolean isMultiValued()
Returns true if this property is multi-valued, otherwise false.- Returns:
- true if this property is multi-valued, otherwise false.
-
setValues
public void setValues(InternalValue[] values)
Sets the value(s) of this property.- Parameters:
values
- the new values
-
getValues
public InternalValue[] getValues()
Returns the value(s) of this property.- Returns:
- the value(s) of this property.
-
calculateMemoryFootprint
public long calculateMemoryFootprint()
Returns an estimate of the memory size of this property state. The return value actually highly overestimates the amount of required memory, but changing the estimates would likely cause OOMs in many downstream deployments that have set their cache sizes based on experience with these erroneous size estimates. So we don't change the formula used by this method.- Specified by:
calculateMemoryFootprint
in classItemState
- Returns:
- the approximate memory consumption of this state.
-
-