public class NodeState extends ItemState
NodeState
represents the state of a Node
.ItemState.MergeResult, ItemState.SimpleMergeResult
Modifier | Constructor and Description |
---|---|
protected |
NodeState(NodeEntry entry,
Name nodeTypeName,
Name[] mixinTypeNames,
ItemStateFactory isf,
QNodeDefinition definition,
ItemDefinitionProvider definitionProvider)
Constructs a NEW NodeState
|
protected |
NodeState(NodeEntry entry,
NodeInfo nInfo,
ItemStateFactory isf,
ItemDefinitionProvider definitionProvider)
Constructs an EXISTING NodeState
|
Modifier and Type | Method and Description |
---|---|
Name[] |
getAllNodeTypeNames()
TODO: clarify usage
In case the status of the given node state is not
Status.EXISTING
the transiently added mixin types are taken into account as well. |
NodeState |
getChildNodeState(Name nodeName,
int index)
Utility
Returns the child
NodeState with the specified name
and index. |
QNodeDefinition |
getDefinition()
Returns the
definition defined for this
node state. |
ItemId |
getId()
Utility method:
Returns the identifier of this item state.
|
Name[] |
getMixinTypeNames()
Returns the names of this node's mixin types.
|
NodeEntry |
getNodeEntry() |
NodeId |
getNodeId()
Returns the id of this node state.
|
Iterator<PropertyId> |
getNodeReferences(Name propertyName,
boolean weak)
Returns the identifiers of all reference properties that point to
this node.
|
Name |
getNodeTypeName()
Returns the name of this node's node type.
|
Name[] |
getNodeTypeNames()
Return all nodetype names that are defined to this
NodeState
including the primary nodetype and the mixins. |
PropertyState |
getPropertyState(Name propertyName)
Utility method that returns the property state with the given name or
throws an
ItemNotFoundException if no matching, valid
property could be found. |
String |
getUniqueID() |
ItemId |
getWorkspaceId()
Utility method:
Returns the identifier of this item state.
|
boolean |
hasChildNodeEntry(Name name,
int index)
Utility
Determines if there is a valid
NodeEntry with the
specified name and index . |
boolean |
hasDefinition()
Returns true if the definition of this state has already been
calculated.
|
boolean |
hasPropertyName(Name propName)
Utility
|
boolean |
isNode()
Determines if this item state represents a node.
|
boolean |
isRoot()
Returns true, if this
NodeState represent the root node. |
ItemState.MergeResult |
merge(ItemState another,
boolean keepChanges)
Merge all data from the given state into this state.
|
boolean |
revert()
Revert all transient modifications made to this ItemState.
|
void |
setMixinTypeNames(Name[] mixinTypeNames)
Used by NodeEntryImpl and NodeState only
|
addListener, getHierarchyEntry, getListeners, getName, getParent, getPath, getStatus, invalidate, isValid, removeListener, setStatus
protected NodeState(NodeEntry entry, Name nodeTypeName, Name[] mixinTypeNames, ItemStateFactory isf, QNodeDefinition definition, ItemDefinitionProvider definitionProvider)
entry
- nodeTypeName
- mixinTypeNames
- isf
- definition
- definitionProvider
- protected NodeState(NodeEntry entry, NodeInfo nInfo, ItemStateFactory isf, ItemDefinitionProvider definitionProvider)
entry
- nInfo
- isf
- definitionProvider
- public final boolean isNode()
isNode
in class ItemState
ItemState.isNode()
public ItemId getId() throws RepositoryException
hierarchy entry
.getId
in class ItemState
RepositoryException
ItemState.getId()
public ItemId getWorkspaceId() throws RepositoryException
getWorkspaceId
in class ItemState
RepositoryException
ItemState.getWorkspaceId()
public ItemState.MergeResult merge(ItemState another, boolean keepChanges)
ItemState
keepChanges
' is true, transient modifications present on
this state are not touched. Otherwise this state is completely reset
according to the given other state.merge
in class ItemState
ItemState.merge(ItemState, boolean)
public boolean revert()
ItemState
revert
in class ItemState
ItemState.revert()
public NodeEntry getNodeEntry()
NodeEntry
associated with this state.public NodeId getNodeId() throws RepositoryException
RepositoryException
public String getUniqueID()
null
if this
node cannot be identified with a unique ID.public boolean isRoot()
NodeState
represent the root node.NodeState
represent the root node.public Name getNodeTypeName()
public Name[] getMixinTypeNames()
public void setMixinTypeNames(Name[] mixinTypeNames)
mixinTypeNames
- public Name[] getNodeTypeNames()
NodeState
including the primary nodetype and the mixins.public Name[] getAllNodeTypeNames()
Status.EXISTING
the transiently added mixin types are taken into account as well.public boolean hasDefinition() throws RepositoryException
RepositoryException
public QNodeDefinition getDefinition() throws RepositoryException
definition
defined for this
node state. Note, that the definition has been set upon creation or
upon move.RepositoryException
public Iterator<PropertyId> getNodeReferences(Name propertyName, boolean weak)
propertyName
- name filter of referring properties to be returned;
if null
then all references are returned.weak
- Boolean flag indicating whether weak references should be
returned or not.public boolean hasChildNodeEntry(Name name, int index)
NodeEntry
with the
specified name
and index
.name
- Name
object specifying a node name.index
- 1-based index if there are same-name child node entries.true
if there is a NodeEntry
with
the specified name
and index
.public NodeState getChildNodeState(Name nodeName, int index) throws ItemNotFoundException, RepositoryException
NodeState
with the specified name
and index. Throws ItemNotFoundException
if there's no
matching, valid entry.nodeName
- Name
object specifying a node name.index
- 1-based index if there are same-name child node entries.NodeState
with the specified name and indexItemNotFoundException
RepositoryException
public boolean hasPropertyName(Name propName)
propName
- Name
object specifying a property nametrue
if there is a valid property entry with the
specified Name
.public PropertyState getPropertyState(Name propertyName) throws ItemNotFoundException, RepositoryException
ItemNotFoundException
if no matching, valid
property could be found.propertyName
- The name of the property state to return.ItemNotFoundException
- If there is no (valid) property state
with the given name.RepositoryException
- If an error occurs while retrieving the
property state.NodeEntry.getPropertyEntry(Name, boolean)
,
PropertyEntry.getPropertyState()
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.