Class ObjectNode

java.lang.Object
introspector.model.AbstractNode
introspector.model.ObjectNode
All Implemented Interfaces:
Node, Serializable

public class ObjectNode extends AbstractNode implements Node
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 Details

    • hasBeenIsLeafCached

      private boolean hasBeenIsLeafCached
      Indicates if the isLeaf method has been previously called, and hence cached.
    • isLeafCache

      private boolean isLeafCache
      The cached value for isLeaf. Optimization to avoid computing isLeaf with reflection any time it is invoked;
    • hasBeenGetChildrenCached

      private boolean hasBeenGetChildrenCached
      Indicates if the isChildren method has been previously called, and hence cached.
    • getChildrenCache

      private List<Node> getChildrenCache
      The cached value for getChildren. Optimization to avoid computing getChildren with reflection any time it is invoked;
    • FIELD_NAME_ADDED_BY_INTELLIJ

      public static final String FIELD_NAME_ADDED_BY_INTELLIJ
      See Also:
  • Constructor Details

  • Method Details

    • isLeaf

      public boolean isLeaf()
      An object is a leaf node when it has no fields
      Specified by:
      isLeaf in interface Node
      Returns:
      Whether the node is a leaf node (no children) or not
      See Also:
    • getChildren

      public List<Node> getChildren()
      An object has as many child nodes as fields.
      Specified by:
      getChildren in class AbstractNode
      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: Node
      Compare two trees and return the list of modified nodes.
      Specified by:
      compareTrees in interface Node
      Overrides:
      compareTrees in class AbstractNode
      Parameters:
      node2 - The node to compare with the other tree
      equalName - Whether the node names must be the same or not (important for root nodes)
      modifiedNodes - The list of modified nodes
      alreadyTraversed - The list of nodes that have been visited in this traversal
      Returns:
      The list of modified nodes
      See Also: