public interface Node extends CanonicalAccessor
Modifier and Type | Interface and Description |
---|---|
static class |
Node.State
The state of a
Node representing the difference between two objects. |
static interface |
Node.Visitor
Visitor to traverse a node graph.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addChild(Node node)
Adds a child to this node and sets this node as its parent node.
|
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 |
getCircleStartNode() |
PropertyPath |
getCircleStartPath() |
String |
getEqualsOnlyValueProviderMethod() |
Node |
getParentNode() |
<T extends Annotation> |
getPropertyAnnotation(Class<T> annotationClass) |
Set<Annotation> |
getPropertyAnnotations()
If this node represents a bean property this method returns all annotations of its getter.
|
PropertyPath |
getPropertyPath() |
Node.State |
getState() |
Class<?> |
getType() |
boolean |
hasChanges() |
boolean |
hasChildren() |
boolean |
hasEqualsOnlyValueProviderMethod() |
boolean |
isAdded()
Convenience method for
|
boolean |
isChanged()
Convenience method for
|
boolean |
isCircular()
Convenience method for
|
boolean |
isCollectionNode() |
boolean |
isIgnored()
Convenience method for
|
boolean |
isMapNode() |
boolean |
isRemoved()
Convenience method for
|
boolean |
isRootNode() |
boolean |
isUntouched()
Convenience method for
|
boolean |
matches(PropertyPath path) |
void |
setCircleStartNode(Node node) |
void |
setCircleStartPath(PropertyPath circularStartPath) |
void |
setParentNode(Node parent)
Sets the parent node.
|
void |
setState(Node.State state) |
void |
setType(Class<?> aClass)
Allows for explicit type definition.
|
CollectionNode |
toCollectionNode() |
MapNode |
toMapNode() |
void |
visit(Node.Visitor visitor)
Visit this and all child nodes.
|
void |
visitChildren(Node.Visitor visitor)
Visit all child nodes but not this one.
|
canonicalGet, canonicalSet, canonicalUnset
getCategories, getPathElement, isEqualsOnly
static final Node ROOT
Node getParentNode()
void setParentNode(Node parent)
parent
- The parent of this node. May be null, if this is a root node.Node.State getState()
void setState(Node.State state)
state
- The state of this node.boolean matches(PropertyPath path)
boolean isRootNode()
boolean hasChanges()
boolean isAdded()
getState()
== Node.State.ADDED
boolean isChanged()
getState()
== Node.State.CHANGED
boolean isRemoved()
getState()
== Node.State.REMOVED
boolean isUntouched()
getState()
== Node.State.UNTOUCHED
boolean isIgnored()
getState()
== Node.State.IGNORED
isIgnored
in interface PropertyDescriptor
boolean isCircular()
getState()
== Node.State.CIRCULAR
boolean isCollectionNode()
CollectionNode toCollectionNode()
boolean isMapNode()
MapNode toMapNode()
void setCircleStartPath(PropertyPath circularStartPath)
PropertyPath getCircleStartPath()
isCircular()
returns true
.void setCircleStartNode(Node node)
Node getCircleStartNode()
Class<?> getType()
void setType(Class<?> aClass)
getType()
will always
return the type returned by the accessor.aClass
- The type of the value represented by this node.PropertyPath getPropertyPath()
boolean hasChildren()
true
if this node has children.Collection<Node> getChildren()
Node getChild(String propertyName)
propertyName
- The name of the property represented by the child node.null
.Node getChild(PropertyPath path)
path
- The path from the object root to the requested child node.null
.Node getChild(Element pathElement)
pathElement
- The path element of the child node to get.null
.boolean addChild(Node node)
node
- The node to add.void visit(Node.Visitor visitor)
visitor
- The visitor to use.void visitChildren(Node.Visitor visitor)
visitor
- The visitor to use.Set<Annotation> getPropertyAnnotations()
<T extends Annotation> T getPropertyAnnotation(Class<T> annotationClass)
boolean hasEqualsOnlyValueProviderMethod()
hasEqualsOnlyValueProviderMethod
in interface PropertyDescriptor
String getEqualsOnlyValueProviderMethod()
getEqualsOnlyValueProviderMethod
in interface PropertyDescriptor
Copyright © 2013. All Rights Reserved.