org.beanfabrics.meta
Class PathNode

java.lang.Object
  extended by org.beanfabrics.meta.PathNode

public class PathNode
extends java.lang.Object

The PathNode represents the meta data for a specific node inside a PM's tree-like structure, reachable by a given Path relative to a arbitratily defined root node.

With a PathNode you can navigate from a specific node upwards until it's defined root node and downwards until it's leaf nodes.

Note: There is no natural root node for any given PM, because there is no top-level PM class. PM classes can always be combined into greater structures. In this sense any node inside a PMs structure can be arbitrarily choosen to be a root node.


Method Summary
 PathNode asRoot()
          Returns a new PathNode with this node defined as the new root node.
 boolean equals(java.lang.Object obj)
           
 PathNode getChild(java.lang.String name)
          Returns the path element info for the child with he given name.
 java.util.Collection<PathNode> getChildren()
          Returns the path element infos for for all children.
 GenericType getGenericType()
          Returns the generic type representing the Java class of this path element.
 java.lang.String getName()
          Returns the element name of this path element.
 PathNode getNode(Path pathToNode)
          Returns the path element info for the node at the end of the given path.
 PathNode getParent()
          Returns the path element info of this element's parent.
 Path getPath()
          Returns the relative path from the root element to this path element.
 PathNode getRoot()
          Returns the root element.
 TypeInfo getTypeInfo()
          Returns the type info of this element.
 boolean hasChildren()
          Returns whether this element's type info has children.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParent

public PathNode getParent()
Returns the path element info of this element's parent.

Returns:
the path element info of this element's parent

getTypeInfo

public TypeInfo getTypeInfo()
Returns the type info of this element.

Returns:
the type info of this element

getName

public java.lang.String getName()
Returns the element name of this path element.

Returns:
the element name of this path element

hasChildren

public boolean hasChildren()
Returns whether this element's type info has children.

Returns:
whether this element's type info has children

getChildren

public java.util.Collection<PathNode> getChildren()
Returns the path element infos for for all children.

Returns:
the path element infos for for all children

getChild

public PathNode getChild(java.lang.String name)
Returns the path element info for the child with he given name.

Parameters:
name - the property name of the child
Returns:
the path element info for the child with he given name

asRoot

public PathNode asRoot()
Returns a new PathNode with this node defined as the new root node.

Returns:
a new PathNode with this node defined as the new root node

getNode

public PathNode getNode(Path pathToNode)
Returns the path element info for the node at the end of the given path.

Parameters:
pathToNode -
Returns:
the path element info for the node at the end of the given path

getPath

public Path getPath()
Returns the relative path from the root element to this path element.

Returns:
the relative path from the root element to this path element

getGenericType

public GenericType getGenericType()
Returns the generic type representing the Java class of this path element.

Returns:
the generic type representing the Java class of this path element

getRoot

public PathNode getRoot()
Returns the root element.

Returns:
the root element

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object