Package introspector.model
Class ObjectNode
java.lang.Object
introspector.model.AbstractNode
introspector.model.ObjectNode
- All Implemented Interfaces:
Node,Serializable
ObjectNode provides a Node implementation to represent any object whose type is neither built-in
nor a collection. It has as many children as field references pointing to other objects.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe cached value for getChildren.private booleanIndicates if the isChildren method has been previously called, and hence cached.private booleanIndicates if the isLeaf method has been previously called, and hence cached.private booleanThe cached value for isLeaf. -
Constructor Summary
ConstructorsConstructorDescriptionObjectNode(String name, Object value) ObjectNode(String name, Object value, Class<?> type) -
Method Summary
Modifier and TypeMethodDescriptioncompareTrees(Node node2, boolean equalName, Set<Node> modifiedNodes, Set<SymmetricPair<Node, Node>> alreadyTraversed) Compare two trees and return the list of modified nodes.An object has as many child nodes as fields.booleanisLeaf()An object is a leaf node when it has no fieldsMethods inherited from class introspector.model.AbstractNode
equals, getChild, getChildrenCount, getClassName, getIndexOfChild, getName, getNodeDescription, getType, getValue, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface introspector.model.Node
getChild, getChildrenCount, getClassName, getIndexOfChild, getName, getNodeDescription, getType, getValue
-
Field Details
-
hasBeenIsLeafCached
private boolean hasBeenIsLeafCachedIndicates if the isLeaf method has been previously called, and hence cached. -
isLeafCache
private boolean isLeafCacheThe cached value for isLeaf. Optimization to avoid computing isLeaf with reflection any time it is invoked; -
hasBeenGetChildrenCached
private boolean hasBeenGetChildrenCachedIndicates if the isChildren method has been previously called, and hence cached. -
getChildrenCache
The cached value for getChildren. Optimization to avoid computing getChildren with reflection any time it is invoked; -
FIELD_NAME_ADDED_BY_INTELLIJ
- See Also:
-
-
Constructor Details
-
ObjectNode
- See Also:
-
ObjectNode
- See Also:
-
-
Method Details
-
isLeaf
public boolean isLeaf()An object is a leaf node when it has no fields -
getChildren
An object has as many child nodes as fields.- Specified by:
getChildrenin classAbstractNode- Returns:
- The children of this node (null if there are no children)
- See Also:
-
compareTrees
public Set<Node> compareTrees(Node node2, boolean equalName, Set<Node> modifiedNodes, Set<SymmetricPair<Node, Node>> alreadyTraversed) Description copied from interface:NodeCompare two trees and return the list of modified nodes.- Specified by:
compareTreesin interfaceNode- Overrides:
compareTreesin classAbstractNode- Parameters:
node2- The node to compare with the other treeequalName- Whether the node names must be the same or not (important for root nodes)modifiedNodes- The list of modified nodesalreadyTraversed- The list of nodes that have been visited in this traversal- Returns:
- The list of modified nodes
- See Also:
-