net.sf.navel.beans
Class DotNotationExpression

java.lang.Object
  extended by net.sf.navel.beans.DotNotationExpression

public final class DotNotationExpression
extends java.lang.Object

Encapsulates the parse tree generated from a dot-notation expression. This is the chaining of coventional property names, per the JavaBeans spec, with dots (.). It also supports the use of the bracket operator ([]) with or without an enclosed index to represent expressions meant to de-reference elements in List or array properties. This code is useful to all of the access and manipulate logic that needs to consume an arbitrary expression and reflect over or traverse a bean graph.

Author:
cmdln

Constructor Summary
DotNotationExpression(java.lang.String expression)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getDepth()
           
 java.lang.String getExpression()
           
 PropertyExpression getLeaf()
           
 PropertyExpression getRoot()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DotNotationExpression

public DotNotationExpression(java.lang.String expression)
Method Detail

equals

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

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getExpression

public java.lang.String getExpression()
Returns:
The original expression that was parsed to build this instance.

getRoot

public PropertyExpression getRoot()
Returns:
The root expression on the set of linked expressions that describe how to traverse/evaluate the expression.

getLeaf

public PropertyExpression getLeaf()
Returns:
The leaf expression on the set of linked expressions that describe how to traverse/evaluate the expression.

getDepth

public int getDepth()
Returns:
The total number of de-references, exception for indexing, that the expression represents.