org.apache.jackrabbit.core.state
Class PropertyState

java.lang.Object
  extended byorg.apache.jackrabbit.core.state.ItemState
      extended byorg.apache.jackrabbit.core.state.PropertyState
All Implemented Interfaces:
ItemStateListener, Serializable
Direct Known Subclasses:
VirtualPropertyState

public class PropertyState
extends ItemState

PropertyState represents the state of a Property.

See Also:
Serialized Form

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_STALE_MODIFIED, STATUS_UNDEFINED
 
Constructor Summary
PropertyState(PropertyId id, int initialStatus, boolean isTransient)
          Create a new PropertyState
PropertyState(PropertyState overlayedState, int initialStatus, boolean isTransient)
          Constructs a new property state that is initially connected to an overlayed state.
 
Method Summary
protected  void copy(ItemState state)
          Copy state information from another state into this state
 PropDefId getDefinitionId()
          Returns the id of the definition applicable to this property state.
 ItemId getId()
          Returns the identifier of this item.
 QName getName()
          Returns the name of this property.
 NodeId getParentId()
          Returns the NodeId of the parent NodeState or null 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.
 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 setDefinitionId(PropDefId defId)
          Sets the id of the definition applicable to this property state.
 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
addListener, connect, discard, disconnect, getModCount, getOverlayedState, getStatus, hasOverlayedState, isStale, isTransient, notifyStateCreated, notifyStateDestroyed, notifyStateDiscarded, notifyStateUpdated, reconnect, removeListener, setModCount, setStatus, stateCreated, stateDestroyed, stateDiscarded, stateModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 overlayed
initialStatus - the initial status of the property state object
isTransient - flag indicating whether this state is transient or not

PropertyState

public PropertyState(PropertyId id,
                     int initialStatus,
                     boolean isTransient)
Create a new PropertyState

Parameters:
id - id of the property
initialStatus - the initial status of the property state object
isTransient - flag indicating whether this state is transient or not
Method Detail

copy

protected void copy(ItemState state)
Copy state information from another state into this state

Specified by:
copy in class ItemState
Parameters:
state - source state information

isNode

public boolean isNode()
Determines if this item state represents a node.

Specified by:
isNode in class ItemState
Returns:
always false
See Also:
ItemState.isNode()

getId

public ItemId getId()
Returns the identifier of this item.

Specified by:
getId in class ItemState
Returns:
the id 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 parent NodeState or null 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 class ItemState
Returns:
the parent NodeState's Id

getName

public QName 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.

getDefinitionId

public PropDefId getDefinitionId()
Returns the id of the definition applicable to this property state.

Returns:
the id of the definition

setDefinitionId

public void setDefinitionId(PropDefId defId)
Sets the id of the definition applicable to this property state.

Parameters:
defId - the id of the definition

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.


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.