|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.jcr2spi.state.ItemState
org.apache.jackrabbit.jcr2spi.state.NodeState
public class NodeState
NodeState
represents the state of a Node
.
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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. |
PropertyId[] |
getNodeReferences()
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. |
boolean |
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 |
Methods inherited from class org.apache.jackrabbit.jcr2spi.state.ItemState |
---|
addListener, getHierarchyEntry, getListeners, getName, getParent, getQPath, getStatus, isValid, removeListener, setStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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
- Method Detail |
---|
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 boolean 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 PropertyId[] getNodeReferences()
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 index
ItemNotFoundException
RepositoryException
public boolean hasPropertyName(Name propName)
propName
- Name
object specifying a property name
true
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |