org.apache.bval.jsr303.util
Class NodeImpl

java.lang.Object
  extended by org.apache.bval.jsr303.util.NodeImpl
All Implemented Interfaces:
Serializable, Path.Node

public final class NodeImpl
extends Object
implements Path.Node, Serializable

Description: a node (property) as part of a Path. (Implementation based on reference implementation)

See Also:
Serialized Form

Constructor Summary
NodeImpl(Path.Node node)
          Create a new NodeImpl instance.
NodeImpl(String name)
          Create a new NodeImpl instance.
 
Method Summary
static StringBuilder appendNode(Path.Node node, StringBuilder to)
          Append a Node to the specified StringBuilder.
static NodeImpl atIndex(Integer index)
          Get a NodeImpl indexed from the preceding node (or root).
static NodeImpl atKey(Object key)
          Get a NodeImpl keyed from the preceding node (or root).
 boolean equals(Object o)
          
 Integer getIndex()
          
 Object getKey()
          
 String getName()
          
 int hashCode()
          
 boolean isInIterable()
          
 void setIndex(Integer index)
          Set the index of this node, implying inIterable.
 void setInIterable(boolean inIterable)
          Set whether this node represents a contained value of an Iterable or Map.
 void setKey(Object key)
          Set the map key of this node, implying inIterable.
 void setName(String name)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeImpl

public NodeImpl(String name)
Create a new NodeImpl instance.

Parameters:
name -

NodeImpl

NodeImpl(Path.Node node)
Create a new NodeImpl instance.

Parameters:
node -
Method Detail

appendNode

public static StringBuilder appendNode(Path.Node node,
                                       StringBuilder to)
Append a Node to the specified StringBuilder.

Parameters:
node -
to -
Returns:
to

atIndex

public static NodeImpl atIndex(Integer index)
Get a NodeImpl indexed from the preceding node (or root).

Parameters:
index -
Returns:
NodeImpl

atKey

public static NodeImpl atKey(Object key)
Get a NodeImpl keyed from the preceding node (or root).

Parameters:
key -
Returns:
NodeImpl

getName

public String getName()

Specified by:
getName in interface Path.Node

setName

public void setName(String name)
Parameters:
name - the name to set

isInIterable

public boolean isInIterable()

Specified by:
isInIterable in interface Path.Node

setInIterable

public void setInIterable(boolean inIterable)
Set whether this node represents a contained value of an Iterable or Map.

Parameters:
inIterable -

getIndex

public Integer getIndex()

Specified by:
getIndex in interface Path.Node

setIndex

public void setIndex(Integer index)
Set the index of this node, implying inIterable.

Parameters:
index -

getKey

public Object getKey()

Specified by:
getKey in interface Path.Node

setKey

public void setKey(Object key)
Set the map key of this node, implying inIterable.

Parameters:
key -

toString

public String toString()

Overrides:
toString in class Object

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


Copyright © 2010-2012 Apache Software Foundation. All Rights Reserved.