org.hibernate.validator.engine
Class PathImpl

java.lang.Object
  extended by org.hibernate.validator.engine.PathImpl
All Implemented Interfaces:
Serializable, Iterable<Path.Node>, Path

public final class PathImpl
extends Object
implements Path, Serializable

Author:
Hardy Ferentschik, Gunnar Morling, Kevin Pollet - SERLI - (kevin.pollet@serli.com)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.validation.Path
Path.Node
 
Field Summary
static String PROPERTY_PATH_SEPARATOR
           
 
Method Summary
 NodeImpl addNode(String nodeName)
           
 String asString()
           
 void buildHashCode()
           
static PathImpl createCopy(PathImpl path)
           
static PathImpl createNewPath(String name)
           
static PathImpl createPathForMethodParameter(Method method, String parameterName)
          Creates a path representing the specified method parameter.
static PathImpl createPathForMethodReturnValue(Method method)
           
static PathImpl createPathFromString(String propertyPath)
          Returns a Path instance representing the path described by the given string.
static PathImpl createRootPath()
           
 boolean equals(Object o)
           
 NodeImpl getLeafNode()
           
 PathImpl getPathWithoutLeafNode()
           
 int hashCode()
           
 boolean isRootPath()
           
 Iterator<Path.Node> iterator()
           
 NodeImpl makeLeafNodeIterable()
           
 NodeImpl setLeafNodeIndex(Integer index)
           
 NodeImpl setLeafNodeMapKey(Object key)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_PATH_SEPARATOR

public static final String PROPERTY_PATH_SEPARATOR
See Also:
Constant Field Values
Method Detail

createPathFromString

public static PathImpl createPathFromString(String propertyPath)
Returns a Path instance representing the path described by the given string. To create a root node the empty string should be passed.

Parameters:
propertyPath - the path as string representation.
Returns:
a Path instance representing the path described by the given string.
Throws:
IllegalArgumentException - in case property == null or property cannot be parsed.

createPathForMethodParameter

public static PathImpl createPathForMethodParameter(Method method,
                                                    String parameterName)
Creates a path representing the specified method parameter.

Parameters:
method - The method hosting the parameter to represent.
parameterName - The parameter's name, e.g. "arg0" or "param1".
Returns:
A path representing the specified method parameter.

createPathForMethodReturnValue

public static PathImpl createPathForMethodReturnValue(Method method)

createNewPath

public static PathImpl createNewPath(String name)

createRootPath

public static PathImpl createRootPath()

createCopy

public static PathImpl createCopy(PathImpl path)

isRootPath

public final boolean isRootPath()

getPathWithoutLeafNode

public final PathImpl getPathWithoutLeafNode()

addNode

public final NodeImpl addNode(String nodeName)

makeLeafNodeIterable

public final NodeImpl makeLeafNodeIterable()

setLeafNodeIndex

public final NodeImpl setLeafNodeIndex(Integer index)

setLeafNodeMapKey

public final NodeImpl setLeafNodeMapKey(Object key)

getLeafNode

public final NodeImpl getLeafNode()

iterator

public final Iterator<Path.Node> iterator()
Specified by:
iterator in interface Iterable<Path.Node>

asString

public final String asString()

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

buildHashCode

public void buildHashCode()


Copyright © 2007-2011 Red Hat Middleware, LLC. All Rights Reserved