|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.version.NodeStateEx
public class NodeStateEx
This Class provides some basic node operations directly on the node state.
| Constructor Summary | |
|---|---|
NodeStateEx(UpdatableItemStateManager stateMgr,
NodeTypeRegistry ntReg,
NodeId nodeId)
Creates a new persistent node |
|
NodeStateEx(UpdatableItemStateManager stateMgr,
NodeTypeRegistry ntReg,
NodeState nodeState,
Name name)
Creates a new persistent node |
|
| Method Summary | |
|---|---|
NodeStateEx |
addNode(Name nodeName,
Name nodeTypeName,
NodeId id)
Adds a new child node with the given name |
NodeStateEx |
addNode(Name nodeName,
Name nodeTypeName,
NodeId id,
boolean referenceable)
Adds a new child node with the given name |
void |
copyFrom(PropertyImpl prop)
copies a property |
void |
copyFrom(PropertyState prop)
copies a property |
NodeStateEx[] |
getChildNodes()
returns all child nodes |
QNodeDefinition |
getDefinition()
Returns the QNodeDefinition for this state |
QPropertyDefinition |
getDefinition(PropertyState prop)
Returns the property definition for the property state |
EffectiveNodeType |
getEffectiveNodeType()
Returns the effective (i.e. |
Name |
getName()
returns the name of this node |
NodeStateEx |
getNode(Name name,
int index)
retrieves the child node with the given name and 1-base index or null if the node does not exist. |
NodeStateEx |
getNode(NodeId id)
Returns the node with the given id. |
NodeId |
getNodeId()
Returns the id of this node. |
NodeStateEx |
getParent()
Returns the parent node of this node |
NodeId |
getParentId()
Returns the parent id of this node |
PropertyState[] |
getProperties()
Returns the properties of this node |
InternalValue |
getPropertyValue(Name name)
Returns the value of the given property or null |
InternalValue[] |
getPropertyValues(Name name)
Returns the values of the given property of null |
NodeState |
getState()
Returns the underlaying node state. |
boolean |
hasAncestor(NodeId nodeId)
Checks if this state has the inidcated ancestor |
boolean |
hasNode(Name name)
checks if the given child node exists. |
boolean |
hasNode(NodeId id)
Checks if the given node state exists |
boolean |
hasProperty(Name name)
Checks if the given property exists |
boolean |
hasProperty(PropertyId id)
Checks if the given property state exists |
NodeStateEx |
moveFrom(NodeStateEx src,
Name name,
boolean createShare)
Moves the source node to this node using the given name. |
void |
reload()
reloads the persistent state recursively |
boolean |
removeNode(ChildNodeEntry entry)
removes the child node with the given child node entry |
boolean |
removeNode(Name name)
removes the (first) child node with the given name. |
boolean |
removeNode(Name name,
int index)
removes the child node with the given name and 1-based index |
boolean |
removeNode(NodeStateEx node)
removes the given child node |
boolean |
removeProperty(Name name)
removes the property with the given name |
void |
setMixins(Set<Name> mixinTypeNames)
Sets the given mixin types |
void |
setPropertyValue(Name name,
InternalValue value)
Sets the property value |
void |
setPropertyValues(Name name,
int type,
InternalValue[] values)
Sets the property values |
PropertyState |
setPropertyValues(Name name,
int type,
InternalValue[] values,
boolean multiple)
Sets the property values |
void |
store()
stores the persistent state recursively |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NodeStateEx(UpdatableItemStateManager stateMgr,
NodeTypeRegistry ntReg,
NodeState nodeState,
Name name)
stateMgr - state managerntReg - node type registrynodeState - underlying node statename - name (can be null)
public NodeStateEx(UpdatableItemStateManager stateMgr,
NodeTypeRegistry ntReg,
NodeId nodeId)
throws RepositoryException
stateMgr - state managerntReg - node type registrynodeId - node id
RepositoryException - if the node state can't be loaded| Method Detail |
|---|
public Name getName()
public NodeId getNodeId()
public NodeId getParentId()
public NodeStateEx getParent()
throws RepositoryException
null if root node
RepositoryException - if an error occurspublic NodeState getState()
public PropertyState[] getProperties()
throws ItemStateException
ItemStateException - if an error occurspublic boolean hasProperty(Name name)
name - name of the property
true if the given property exists.public InternalValue[] getPropertyValues(Name name)
null
name - name of the property
public InternalValue getPropertyValue(Name name)
null
name - name of the property
public void setPropertyValue(Name name,
InternalValue value)
throws RepositoryException
name - name of the propertyvalue - value to set
RepositoryException - if an error occurs
public void setPropertyValues(Name name,
int type,
InternalValue[] values)
throws RepositoryException
name - name of the propertytype - property typevalues - values to set
RepositoryException - if an error occurs
public PropertyState setPropertyValues(Name name,
int type,
InternalValue[] values,
boolean multiple)
throws RepositoryException
name - name of the propertytype - type of the valuesvalues - values to setmultiple - truefor MV properties
RepositoryException - if an error occurs
public EffectiveNodeType getEffectiveNodeType()
throws RepositoryException
RepositoryException - if an error occurspublic boolean hasNode(Name name)
name - name of the node
true if the given child exists.
public boolean removeNode(Name name)
throws RepositoryException
name - name of hte node
true if the child was removed
RepositoryException - if an error occurs
public boolean removeNode(NodeStateEx node)
throws RepositoryException
node - child node to remove
true if the child was removed
RepositoryException - if an error occurs
public boolean removeNode(Name name,
int index)
throws RepositoryException
name - name of the child nodeindex - index of the child node
true if the child was removed.
RepositoryException - if an error occurs
public boolean removeNode(ChildNodeEntry entry)
throws RepositoryException
entry - entry to remove
true if the child was removed.
RepositoryException - if an error occurs
public boolean removeProperty(Name name)
throws RepositoryException
name - name of the property
true if the property was removed.
RepositoryException - if an error occurs
public NodeStateEx getNode(Name name,
int index)
throws RepositoryException
null if the node does not exist.
name - name of hte child nodeindex - index of thechild node
RepositoryException - if an error occurs
public NodeStateEx getNode(NodeId id)
throws RepositoryException
id - node id
RepositoryException - if an error occurspublic boolean hasNode(NodeId id)
id - node id
true if the node state existspublic boolean hasProperty(PropertyId id)
id - property id
true if the property state exists
public NodeStateEx addNode(Name nodeName,
Name nodeTypeName,
NodeId id)
throws NoSuchNodeTypeException,
ConstraintViolationException,
RepositoryException
nodeName - name of the new nodenodeTypeName - node type nameid - id of the new node
NoSuchNodeTypeException - if the node type does not exist
ConstraintViolationException - if there is a constraint violation
RepositoryException - if an error occurs
public NodeStateEx addNode(Name nodeName,
Name nodeTypeName,
NodeId id,
boolean referenceable)
throws NoSuchNodeTypeException,
ConstraintViolationException,
RepositoryException
nodeName - name of the new nodenodeTypeName - node type nameid - id of the new nodereferenceable - if true, a UUID property is created
NoSuchNodeTypeException - if the node type does not exist
ConstraintViolationException - if there is a constraint violation
RepositoryException - if an error occurs
public void setMixins(Set<Name> mixinTypeNames)
throws RepositoryException
mixinTypeNames - the mixin type names
RepositoryException - if an error occurs
public NodeStateEx moveFrom(NodeStateEx src,
Name name,
boolean createShare)
throws RepositoryException
src - shareable source nodename - name of new nodecreateShare - if true a share is created instead.
RepositoryException - if an error occurs
public NodeStateEx[] getChildNodes()
throws RepositoryException
RepositoryException - if an error occurs
public void store()
throws RepositoryException
RepositoryException - if an error occurs
public void reload()
throws RepositoryException
RepositoryException - if an error occurs
public void copyFrom(PropertyImpl prop)
throws RepositoryException
prop - source property
RepositoryException - if an error occurs
public void copyFrom(PropertyState prop)
throws RepositoryException
prop - source property
RepositoryException - if an error occurs
public QNodeDefinition getDefinition()
throws RepositoryException
RepositoryException - if an error occurs
public QPropertyDefinition getDefinition(PropertyState prop)
throws RepositoryException
prop - the property state
RepositoryException - if an error occurs
public boolean hasAncestor(NodeId nodeId)
throws RepositoryException
nodeId - the node id of the ancestor
true if it has the inidicated ancestor
RepositoryException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||