|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.danielbechler.diff.node.DefaultNode
public class DefaultNode
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface de.danielbechler.diff.node.Node |
|---|
Node.State, Node.Visitor |
| Field Summary |
|---|
| Fields inherited from interface de.danielbechler.diff.node.Node |
|---|
ROOT |
| Constructor Summary | |
|---|---|
DefaultNode(Accessor accessor,
Class<?> valueType)
|
|
DefaultNode(Class<?> valueType)
|
|
DefaultNode(Node parentNode,
Accessor accessor,
Class<?> valueType)
|
|
| Method Summary | |
|---|---|
boolean |
addChild(Node node)
Adds a child to this node and sets this node as its parent node. |
Object |
canonicalGet(Object target)
|
void |
canonicalSet(Object target,
Object value)
|
void |
canonicalUnset(Object target)
|
Object |
get(Object target)
|
Set<String> |
getCategories()
|
Node |
getChild(Element pathElement)
Retrieve a child that matches the given path element relative to this node. |
Node |
getChild(PropertyPath path)
Retrieve a child that matches the given absolute path, starting from the current node. |
Node |
getChild(String propertyName)
Retrieve a child with the given property name relative to this node. |
Collection<Node> |
getChildren()
|
Node |
getParentNode()
|
Element |
getPathElement()
|
PropertyPath |
getPropertyPath()
|
Node.State |
getState()
|
Class<?> |
getType()
|
boolean |
hasChanges()
|
boolean |
hasChildren()
|
boolean |
isAdded()
Convenience method for |
boolean |
isChanged()
Convenience method for |
boolean |
isCircular()
Convenience method for |
boolean |
isCollectionNode()
|
boolean |
isEqualsOnly()
|
boolean |
isIgnored()
Convenience method for |
boolean |
isMapNode()
|
boolean |
isRemoved()
Convenience method for |
boolean |
isRootNode()
|
boolean |
isUntouched()
Convenience method for |
boolean |
matches(PropertyPath path)
|
void |
set(Object target,
Object value)
|
void |
setParentNode(Node parentNode)
Sets the parent node. |
void |
setState(Node.State state)
|
void |
setType(Class<?> aClass)
Allows for explicit type definition. |
CollectionNode |
toCollectionNode()
|
MapNode |
toMapNode()
|
String |
toString()
|
void |
unset(Object target)
|
void |
visit(Node.Visitor visitor)
Visit this and all child nodes. |
protected void |
visit(Node.Visitor visitor,
Visit visit)
|
void |
visitChildren(Node.Visitor visitor)
Visit all child nodes but not this one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultNode(Node parentNode,
Accessor accessor,
Class<?> valueType)
public DefaultNode(Accessor accessor,
Class<?> valueType)
public DefaultNode(Class<?> valueType)
| Method Detail |
|---|
public Node.State getState()
getState in interface Nodepublic boolean matches(PropertyPath path)
matches in interface Nodepublic boolean hasChanges()
hasChanges in interface Nodepublic final boolean isAdded()
NodeNode.getState() == Node.State.ADDED
isAdded in interface Nodepublic final boolean isChanged()
NodeNode.getState() == Node.State.CHANGED
isChanged in interface Nodepublic final boolean isRemoved()
NodeNode.getState() == Node.State.REMOVED
isRemoved in interface Nodepublic final boolean isUntouched()
NodeNode.getState() == Node.State.UNTOUCHED
isUntouched in interface Nodepublic boolean isCircular()
NodeNode.getState() == Node.State.CIRCULAR
isCircular in interface Nodepublic final PropertyPath getPropertyPath()
getPropertyPath in interface Nodepublic Element getPathElement()
getPathElement in interface PropertyDescriptorpublic boolean isCollectionNode()
isCollectionNode in interface Nodepublic CollectionNode toCollectionNode()
toCollectionNode in interface Nodepublic boolean isMapNode()
isMapNode in interface Nodepublic MapNode toMapNode()
toMapNode in interface Nodepublic Class<?> getType()
getType in interface Nodepublic void setType(Class<?> aClass)
NodeNode.getType() will always
return the type returned by the accessor.
setType in interface NodeaClass - The type of the value represented by this node.public boolean hasChildren()
hasChildren in interface Nodetrue if this node has children.public Collection<Node> getChildren()
getChildren in interface Nodepublic Node getChild(String propertyName)
Node
getChild in interface NodepropertyName - The name of the property represented by the child node.
null.public Node getChild(PropertyPath path)
Node
getChild in interface Nodepath - The path from the object root to the requested child node.
null.public Node getChild(Element pathElement)
Node
getChild in interface NodepathElement - The path element of the childe node to get.
null.public boolean addChild(Node node)
Node
addChild in interface Nodenode - The node to add.public final void visit(Node.Visitor visitor)
Node
visit in interface Nodevisitor - The visitor to use.
protected final void visit(Node.Visitor visitor,
Visit visit)
public final void visitChildren(Node.Visitor visitor)
Node
visitChildren in interface Nodevisitor - The visitor to use.public final boolean isRootNode()
isRootNode in interface Nodepublic final boolean isEqualsOnly()
isEqualsOnly in interface PropertyDescriptorpublic final boolean isIgnored()
NodeNode.getState() == Node.State.IGNORED
isIgnored in interface PropertyDescriptorisIgnored in interface Nodepublic final Set<String> getCategories()
getCategories in interface PropertyDescriptorpublic final void setState(Node.State state)
setState in interface Nodestate - The state of this node.public Node getParentNode()
getParentNode in interface Nodepublic final void setParentNode(Node parentNode)
Node
setParentNode in interface NodeparentNode - The parent of this node. May be null, if this is a root node.public Object get(Object target)
get in interface Accessor
public void set(Object target,
Object value)
set in interface Accessorpublic void unset(Object target)
unset in interface Accessorpublic Object canonicalGet(Object target)
canonicalGet in interface CanonicalAccessor
public void canonicalSet(Object target,
Object value)
canonicalSet in interface CanonicalAccessorpublic void canonicalUnset(Object target)
canonicalUnset in interface CanonicalAccessorpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||