org.hibernate.validator.engine
Class ValueContext<T,V>

java.lang.Object
  extended by org.hibernate.validator.engine.ValueContext<T,V>

public class ValueContext<T,V>
extends Object

An instance of this class is used to collect all the relevant information for validating a single class, property or method invocation.

Author:
Hardy Ferentschik, Gunnar Morling

Constructor Summary
protected ValueContext(T currentBean, Class<T> currentBeanType, PathImpl propertyPath)
           
 
Method Summary
 void appendNode(String node)
          Adds a new node with the specified name to the current property path.
 T getCurrentBean()
           
 Class<T> getCurrentBeanType()
           
 Class<?> getCurrentGroup()
           
 V getCurrentValidatedValue()
           
 ElementType getElementType()
           
static
<T,V> ValueContext<T,V>
getLocalExecutionContext(Class<T> type, PathImpl propertyPath)
           
static
<T,V> ValueContext<T,V>
getLocalExecutionContext(T value, PathImpl propertyPath)
           
static
<T,V> ValueContext<T,V>
getLocalExecutionContext(T value, PathImpl propertyPath, int parameterIndex, String parameterName)
           
 Integer getParameterIndex()
           
 String getParameterName()
           
 PathImpl getPropertyPath()
           
 Type getTypeOfAnnotatedElement()
           
 void markCurrentPropertyAsIterable()
           
 void setCurrentGroup(Class<?> currentGroup)
           
 void setCurrentValidatedValue(V currentValue)
           
 void setElementType(ElementType elementType)
           
 void setIndex(Integer index)
           
 void setKey(Object key)
           
 void setParameterIndex(int parameterIndex)
           
 void setParameterName(String parameterName)
           
 void setPropertyPath(PathImpl propertyPath)
          Sets the property path to the match the currently validated value.
 void setTypeOfAnnotatedElement(Type typeOfAnnotatedElement)
           
 String toString()
           
 boolean validatingDefault()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueContext

protected ValueContext(T currentBean,
                       Class<T> currentBeanType,
                       PathImpl propertyPath)
Method Detail

getLocalExecutionContext

public static <T,V> ValueContext<T,V> getLocalExecutionContext(T value,
                                                               PathImpl propertyPath)

getLocalExecutionContext

public static <T,V> ValueContext<T,V> getLocalExecutionContext(T value,
                                                               PathImpl propertyPath,
                                                               int parameterIndex,
                                                               String parameterName)

getLocalExecutionContext

public static <T,V> ValueContext<T,V> getLocalExecutionContext(Class<T> type,
                                                               PathImpl propertyPath)

getPropertyPath

public final PathImpl getPropertyPath()
Returns:
returns the current path.

getCurrentGroup

public final Class<?> getCurrentGroup()

getCurrentBean

public final T getCurrentBean()

getCurrentBeanType

public final Class<T> getCurrentBeanType()

getParameterIndex

public Integer getParameterIndex()

setParameterIndex

public void setParameterIndex(int parameterIndex)

getParameterName

public String getParameterName()

setParameterName

public void setParameterName(String parameterName)

getCurrentValidatedValue

public final V getCurrentValidatedValue()

setPropertyPath

public final void setPropertyPath(PathImpl propertyPath)
Sets the property path to the match the currently validated value. To avoid side effects a copy of the provided path is stored.

Parameters:
propertyPath - Sets the new property path.

appendNode

public final void appendNode(String node)
Adds a new node with the specified name to the current property path.

Parameters:
node - the name of the new node. Cannot be null.

markCurrentPropertyAsIterable

public final void markCurrentPropertyAsIterable()

setKey

public final void setKey(Object key)

setIndex

public final void setIndex(Integer index)

setCurrentGroup

public final void setCurrentGroup(Class<?> currentGroup)

setCurrentValidatedValue

public final void setCurrentValidatedValue(V currentValue)

validatingDefault

public final boolean validatingDefault()

getElementType

public final ElementType getElementType()

setElementType

public final void setElementType(ElementType elementType)

getTypeOfAnnotatedElement

public final Type getTypeOfAnnotatedElement()

setTypeOfAnnotatedElement

public final void setTypeOfAnnotatedElement(Type typeOfAnnotatedElement)

toString

public String toString()
Overrides:
toString in class Object


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