|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jackrabbit.core.state.ItemState
org.apache.jackrabbit.core.state.NodeState
NodeState represents the state of a Node.
| Nested Class Summary | |
static class |
NodeState.ChildNodeEntry
ChildNodeEntry specifies the name, index (in the case of
same-name siblings) and the UUID of a child node entry. |
| Field Summary | |
protected org.apache.jackrabbit.core.state.NodeState.ChildNodeEntries |
childNodeEntries
insertion-ordered collection of ChildNodeEntry objects |
protected NodeDefId |
defId
id of this node's definition |
protected Set |
mixinTypeNames
the names of this node's mixin types |
protected QName |
nodeTypeName
the name of this node's primary type |
protected Set |
propertyNames
set of property names (QName objects) |
protected String |
uuid
the uuid of this node |
| Fields inherited from class org.apache.jackrabbit.core.state.ItemState |
id, overlayedState, parentUUID, status, STATUS_EXISTING, STATUS_EXISTING_MODIFIED, STATUS_EXISTING_REMOVED, STATUS_NEW, STATUS_STALE_DESTROYED, STATUS_STALE_MODIFIED, STATUS_UNDEFINED |
| Constructor Summary | |
NodeState(NodeState overlayedState,
int initialStatus,
boolean isTransient)
Constructor |
|
NodeState(String uuid,
QName nodeTypeName,
String parentUUID,
int initialStatus,
boolean isTransient)
Constructor |
|
| Method Summary | |
NodeState.ChildNodeEntry |
addChildNodeEntry(QName nodeName,
String uuid)
Adds a new ChildNodeEntry. |
void |
addListener(ItemStateListener listener)
Add an ItemStateListener
If the listener passed is at the same time a NodeStateListener
we add it to our list of specialized listeners. |
void |
addPropertyName(QName propName)
Adds a property name entry. |
protected void |
copy(ItemState state)
Copy state information from a state into this state |
List |
getAddedChildNodeEntries()
Returns a list of child node entries that do not exist in the overlayed node state but have been added to this node state. |
Set |
getAddedPropertyNames()
Returns a set of QNames denoting those properties that
do not exist in the overlayed node state but have been added to
this node state. |
List |
getChildNodeEntries()
Returns a list of ChildNodeEntry objects denoting the
child nodes of this node. |
List |
getChildNodeEntries(QName nodeName)
Returns a list of ChildNodeEntrys with the specified name. |
NodeState.ChildNodeEntry |
getChildNodeEntry(QName nodeName,
int index)
Returns the ChildNodeEntry with the specified name and index
or null if there's no such entry. |
NodeState.ChildNodeEntry |
getChildNodeEntry(String uuid)
Returns the ChildNodeEntry with the specified uuid or
null if there's no such entry. |
NodeDefId |
getDefinitionId()
Returns the id of the definition applicable to this node state. |
Set |
getMixinTypeNames()
Returns the names of this node's mixin types. |
QName |
getNodeTypeName()
Returns the name of this node's node type. |
Set |
getPropertyNames()
Returns the names of this node's properties as a set of QNames objects. |
List |
getRemovedChildNodeEntries()
Returns a list of child node entries, that exist in the overlayed node state but have been removed from this node state. |
Set |
getRemovedPropertyNames()
Returns a set of QNames denoting those properties that
exist in the overlayed node state but have been removed from
this node state. |
List |
getReorderedChildNodeEntries()
Returns a list of child node entries that exist both in this node state and in the overlayed node state but have been reordered. |
String |
getUUID()
Returns the UUID of the repository node this node state is representing. |
boolean |
hasChildNodeEntries()
Determines if there are any child node entries. |
boolean |
hasChildNodeEntry(QName name)
Determines if there is a ChildNodeEntry with the
specified name. |
boolean |
hasChildNodeEntry(QName name,
int index)
Determines if there is a ChildNodeEntry with the
specified name and index. |
boolean |
hasChildNodeEntry(String uuid)
Determines if there is a ChildNodeEntry with the
specified uuid. |
boolean |
hasPropertyName(QName propName)
Determines if there is a property entry with the specified QName. |
boolean |
isNode()
Determines if this item state represents a node. |
protected void |
notifyNodeAdded(NodeState.ChildNodeEntry added)
Notify the listeners that a child node entry has been added |
protected void |
notifyNodeRemoved(NodeState.ChildNodeEntry removed)
Notify the listeners that a child node entry has been removed |
protected void |
notifyNodesReplaced()
Notify the listeners that the child node entries have been replaced |
void |
removeAllChildNodeEntries()
Removes all ChildNodeEntrys. |
void |
removeAllPropertyNames()
Removes all property name entries. |
boolean |
removeChildNodeEntry(QName nodeName,
int index)
Removes a ChildNodeEntry. |
boolean |
removeChildNodeEntry(String uuid)
Removes a ChildNodeEntry. |
void |
removeListener(ItemStateListener listener)
Remove an ItemStateListener
If the listener passed is at the same time a NodeStateListener
we remove it from our list of specialized listeners. |
boolean |
removePropertyName(QName propName)
Removes a property name entry. |
boolean |
renameChildNodeEntry(QName oldName,
int index,
QName newName)
Renames a new ChildNodeEntry. |
void |
setChildNodeEntries(List nodeEntries)
Sets the list of ChildNodeEntry objects denoting the
child nodes of this node. |
void |
setDefinitionId(NodeDefId defId)
Sets the id of the definition applicable to this node state. |
void |
setMixinTypeNames(Set names)
Sets the names of this node's mixin types. |
void |
setNodeTypeName(QName nodeTypeName)
Set the node type name. |
void |
setPropertyNames(Set propNames)
Sets the set of QName objects denoting the
properties of this node. |
| Methods inherited from class org.apache.jackrabbit.core.state.ItemState |
connect, discard, disconnect, getId, getOverlayedState, getParentUUID, getStatus, hasOverlayedState, isStale, isTransient, notifyStateCreated, notifyStateDestroyed, notifyStateDiscarded, notifyStateUpdated, reconnect, setParentUUID, setStatus, stateCreated, stateDestroyed, stateDiscarded, stateModified |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected String uuid
protected QName nodeTypeName
protected Set mixinTypeNames
protected NodeDefId defId
protected org.apache.jackrabbit.core.state.NodeState.ChildNodeEntries childNodeEntries
protected Set propertyNames
| Constructor Detail |
public NodeState(NodeState overlayedState,
int initialStatus,
boolean isTransient)
overlayedState - the backing node state being overlayedinitialStatus - the initial status of the node state objectisTransient - flag indicating whether this state is transient or not
public NodeState(String uuid,
QName nodeTypeName,
String parentUUID,
int initialStatus,
boolean isTransient)
uuid - the UUID of the this nodenodeTypeName - node type of this nodeparentUUID - the UUID of the parent nodeinitialStatus - the initial status of the node state objectisTransient - flag indicating whether this state is transient or not| Method Detail |
protected void copy(ItemState state)
copy in class ItemStatestate - source state informationpublic final boolean isNode()
isNode in class ItemStateItemState.isNode()public QName getNodeTypeName()
public Set getMixinTypeNames()
public void setMixinTypeNames(Set names)
names - set of names of mixin typespublic NodeDefId getDefinitionId()
public void setDefinitionId(NodeDefId defId)
defId - the id of the definitionpublic String getUUID()
public boolean hasChildNodeEntries()
true if there are child node entries,
false otherwise.public boolean hasChildNodeEntry(QName name)
ChildNodeEntry with the
specified name.
name - QName object specifying a node name
true if there is a ChildNodeEntry with
the specified name.public boolean hasChildNodeEntry(String uuid)
ChildNodeEntry with the
specified uuid.
uuid - UUID of the child node
true if there is a ChildNodeEntry with
the specified name.
public boolean hasChildNodeEntry(QName name,
int index)
ChildNodeEntry with the
specified name and index.
name - QName object specifying a node nameindex - 1-based index if there are same-name child node entries
true if there is a ChildNodeEntry with
the specified name and index.public boolean hasPropertyName(QName propName)
QName.
propName - QName object specifying a property name
true if there is a property entry with the specified
QName.
public NodeState.ChildNodeEntry getChildNodeEntry(QName nodeName,
int index)
ChildNodeEntry with the specified name and index
or null if there's no such entry.
nodeName - QName object specifying a node nameindex - 1-based index if there are same-name child node entries
ChildNodeEntry with the specified name and index
or null if there's no such entry.public NodeState.ChildNodeEntry getChildNodeEntry(String uuid)
ChildNodeEntry with the specified uuid or
null if there's no such entry.
uuid - UUID of the child node
ChildNodeEntry with the specified uuid or
null if there's no such entry.addChildNodeEntry(org.apache.jackrabbit.name.QName, java.lang.String),
removeChildNodeEntry(org.apache.jackrabbit.name.QName, int)public List getChildNodeEntries()
ChildNodeEntry objects denoting the
child nodes of this node.
ChildNodeEntry objectsaddChildNodeEntry(org.apache.jackrabbit.name.QName, java.lang.String),
removeChildNodeEntry(org.apache.jackrabbit.name.QName, int)public List getChildNodeEntries(QName nodeName)
ChildNodeEntrys with the specified name.
nodeName - name of the child node entries that should be returned
ChildNodeEntry objectsaddChildNodeEntry(org.apache.jackrabbit.name.QName, java.lang.String),
removeChildNodeEntry(org.apache.jackrabbit.name.QName, int)
public NodeState.ChildNodeEntry addChildNodeEntry(QName nodeName,
String uuid)
ChildNodeEntry.
nodeName - QName object specifying the name of the new entry.uuid - UUID the new entry is refering to.
ChildNodeEntry
public boolean renameChildNodeEntry(QName oldName,
int index,
QName newName)
ChildNodeEntry.
oldName - QName object specifying the entry's old nameindex - 1-based index if there are same-name child node entriesnewName - QName object specifying the entry's new name
true if the entry was sucessfully renamed;
otherwise false
public boolean removeChildNodeEntry(QName nodeName,
int index)
ChildNodeEntry.
nodeName - ChildNodeEntry object specifying a node nameindex - 1-based index if there are same-name child node entries
true if the specified child node entry was found
in the list of child node entries and could be removed.public boolean removeChildNodeEntry(String uuid)
ChildNodeEntry.
uuid - UUID of the entry to be removed
true if the specified child node entry was found
in the list of child node entries and could be removed.public void removeAllChildNodeEntries()
ChildNodeEntrys.
public void setChildNodeEntries(List nodeEntries)
ChildNodeEntry objects denoting the
child nodes of this node.
public Set getPropertyNames()
QNames objects.
QNames objectsaddPropertyName(org.apache.jackrabbit.name.QName),
removePropertyName(org.apache.jackrabbit.name.QName)public void addPropertyName(QName propName)
propName - QName object specifying the property namepublic boolean removePropertyName(QName propName)
propName - QName object specifying the property name
true if the specified property name was found
in the list of property name entries and could be removed.public void removeAllPropertyNames()
public void setPropertyNames(Set propNames)
QName objects denoting the
properties of this node.
public void setNodeTypeName(QName nodeTypeName)
nodeTypeName - node type namepublic Set getAddedPropertyNames()
QNames denoting those properties that
do not exist in the overlayed node state but have been added to
this node state.
QNames denoting the properties that have
been added.public List getAddedChildNodeEntries()
public Set getRemovedPropertyNames()
QNames denoting those properties that
exist in the overlayed node state but have been removed from
this node state.
QNames denoting the properties that have
been removed.public List getRemovedChildNodeEntries()
public List getReorderedChildNodeEntries()
+ node1 + node2 + node3After reorder:
+ node2 + node3 + node1All nodes have changed their absolute position. The returned list however may only return that
node1 has been reordered (from the
first position to the end).
public void addListener(ItemStateListener listener)
ItemStateListener
If the listener passed is at the same time a NodeStateListener
we add it to our list of specialized listeners.
addListener in class ItemStatelistener - the new listener to be informed on modificationspublic void removeListener(ItemStateListener listener)
ItemStateListener
If the listener passed is at the same time a NodeStateListener
we remove it from our list of specialized listeners.
removeListener in class ItemStatelistener - an existing listenerprotected void notifyNodeAdded(NodeState.ChildNodeEntry added)
protected void notifyNodesReplaced()
protected void notifyNodeRemoved(NodeState.ChildNodeEntry removed)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||