org.hibernate.validator.cfg.context.impl
Class ConstraintMappingContext

java.lang.Object
  extended by org.hibernate.validator.cfg.context.impl.ConstraintMappingContext

public class ConstraintMappingContext
extends Object

Context which collects constraints, cascades etc. configured via the programmatic API.

Author:
Hardy Ferentschik, Gunnar Morling, Kevin Pollet - SERLI - (kevin.pollet@serli.om)

Constructor Summary
ConstraintMappingContext()
           
 
Method Summary
 void addCascadeConfig(BeanConstraintLocation cascade)
           
 void addConstraintConfig(ConfiguredConstraint<?,BeanConstraintLocation> constraint)
           
 void addDefaultGroupSequence(Class<?> beanClass, List<Class<?>> defaultGroupSequence)
           
<T extends DefaultGroupSequenceProvider<?>>
void
addDefaultGroupSequenceProvider(Class<?> beanClass, Class<T> defaultGroupSequenceProviderClass)
           
 void addMethodCascadeConfig(MethodConstraintLocation cascade)
           
 void addMethodConstraintConfig(ConfiguredConstraint<?,MethodConstraintLocation> constraint)
           
 Map<Class<?>,List<BeanConstraintLocation>> getCascadeConfig()
           
 Collection<Class<?>> getConfiguredClasses()
           
 Map<Class<?>,List<ConfiguredConstraint<?,BeanConstraintLocation>>> getConstraintConfig()
          Returns all constraint definitions registered with this mapping.
 Class<? extends DefaultGroupSequenceProvider<?>> getDefaultGroupSequenceProvider(Class<?> beanType)
          Returns the class of the default group sequence provider defined for the given bean type.
 List<Class<?>> getDefaultSequence(Class<?> beanType)
           
static ConstraintMappingContext getFromMapping(ConstraintMapping mapping)
          Returns the constraint mapping context from the given constraint mapping.
 Map<Class<?>,List<MethodConstraintLocation>> getMethodCascadeConfig()
           
 Map<Class<?>,List<ConfiguredConstraint<?,MethodConstraintLocation>>> getMethodConstraintConfig()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstraintMappingContext

public ConstraintMappingContext()
Method Detail

getFromMapping

public static ConstraintMappingContext getFromMapping(ConstraintMapping mapping)
Returns the constraint mapping context from the given constraint mapping.


getConstraintConfig

public final Map<Class<?>,List<ConfiguredConstraint<?,BeanConstraintLocation>>> getConstraintConfig()
Returns all constraint definitions registered with this mapping.

Returns:
A map with this mapping's constraint definitions. Each key in this map represents a bean type, for which the constraint definitions in the associated map value are configured.

getMethodConstraintConfig

public Map<Class<?>,List<ConfiguredConstraint<?,MethodConstraintLocation>>> getMethodConstraintConfig()

getCascadeConfig

public final Map<Class<?>,List<BeanConstraintLocation>> getCascadeConfig()

getMethodCascadeConfig

public final Map<Class<?>,List<MethodConstraintLocation>> getMethodCascadeConfig()

getConfiguredClasses

public final Collection<Class<?>> getConfiguredClasses()

getDefaultSequence

public final List<Class<?>> getDefaultSequence(Class<?> beanType)

getDefaultGroupSequenceProvider

public final Class<? extends DefaultGroupSequenceProvider<?>> getDefaultGroupSequenceProvider(Class<?> beanType)
Returns the class of the default group sequence provider defined for the given bean type.

Parameters:
beanType - The bean type.
Returns:
The default group sequence provider defined class or null if none.

toString

public String toString()
Overrides:
toString in class Object

addCascadeConfig

public final void addCascadeConfig(BeanConstraintLocation cascade)

addMethodCascadeConfig

public final void addMethodCascadeConfig(MethodConstraintLocation cascade)

addDefaultGroupSequence

public final void addDefaultGroupSequence(Class<?> beanClass,
                                          List<Class<?>> defaultGroupSequence)

addDefaultGroupSequenceProvider

public final <T extends DefaultGroupSequenceProvider<?>> void addDefaultGroupSequenceProvider(Class<?> beanClass,
                                                                                              Class<T> defaultGroupSequenceProviderClass)

addConstraintConfig

public final void addConstraintConfig(ConfiguredConstraint<?,BeanConstraintLocation> constraint)

addMethodConstraintConfig

public final void addMethodConstraintConfig(ConfiguredConstraint<?,MethodConstraintLocation> constraint)


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