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

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

public class ConstraintMappingContext
extends java.lang.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(java.lang.Class<?> beanClass, java.util.List<java.lang.Class<?>> defaultGroupSequence)
           
<T extends DefaultGroupSequenceProvider<?>>
void
addDefaultGroupSequenceProvider(java.lang.Class<?> beanClass, java.lang.Class<T> defaultGroupSequenceProviderClass)
           
 void addMethodCascadeConfig(MethodConstraintLocation cascade)
           
 void addMethodConstraintConfig(ConfiguredConstraint<?,MethodConstraintLocation> constraint)
           
 java.util.Map<java.lang.Class<?>,java.util.List<BeanConstraintLocation>> getCascadeConfig()
           
 java.util.Collection<java.lang.Class<?>> getConfiguredClasses()
           
 java.util.Map<java.lang.Class<?>,java.util.List<ConfiguredConstraint<?,BeanConstraintLocation>>> getConstraintConfig()
          Returns all constraint definitions registered with this mapping.
 java.lang.Class<? extends DefaultGroupSequenceProvider<?>> getDefaultGroupSequenceProvider(java.lang.Class<?> beanType)
          Returns the class of the default group sequence provider defined for the given bean type.
 java.util.List<java.lang.Class<?>> getDefaultSequence(java.lang.Class<?> beanType)
           
static ConstraintMappingContext getFromMapping(ConstraintMapping mapping)
          Returns the constraint mapping context from the given constraint mapping.
 java.util.Map<java.lang.Class<?>,java.util.List<MethodConstraintLocation>> getMethodCascadeConfig()
           
 java.util.Map<java.lang.Class<?>,java.util.List<ConfiguredConstraint<?,MethodConstraintLocation>>> getMethodConstraintConfig()
           
 java.lang.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 java.util.Map<java.lang.Class<?>,java.util.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 java.util.Map<java.lang.Class<?>,java.util.List<ConfiguredConstraint<?,MethodConstraintLocation>>> getMethodConstraintConfig()

getCascadeConfig

public final java.util.Map<java.lang.Class<?>,java.util.List<BeanConstraintLocation>> getCascadeConfig()

getMethodCascadeConfig

public final java.util.Map<java.lang.Class<?>,java.util.List<MethodConstraintLocation>> getMethodCascadeConfig()

getConfiguredClasses

public final java.util.Collection<java.lang.Class<?>> getConfiguredClasses()

getDefaultSequence

public final java.util.List<java.lang.Class<?>> getDefaultSequence(java.lang.Class<?> beanType)

getDefaultGroupSequenceProvider

public final java.lang.Class<? extends DefaultGroupSequenceProvider<?>> getDefaultGroupSequenceProvider(java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object

addCascadeConfig

public final void addCascadeConfig(BeanConstraintLocation cascade)

addMethodCascadeConfig

public final void addMethodCascadeConfig(MethodConstraintLocation cascade)

addDefaultGroupSequence

public final void addDefaultGroupSequence(java.lang.Class<?> beanClass,
                                          java.util.List<java.lang.Class<?>> defaultGroupSequence)

addDefaultGroupSequenceProvider

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

addConstraintConfig

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

addMethodConstraintConfig

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


Copyright © 2011 Oracle Corporation. All Rights Reserved.