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

java.lang.Object
  extended by org.hibernate.validator.cfg.context.impl.ConstraintMappingContextImplBase
      extended by org.hibernate.validator.cfg.context.impl.ReturnValueConstraintMappingContextImpl
All Implemented Interfaces:
Cascadable<ReturnValueConstraintMappingContext>, Constrainable<ReturnValueConstraintMappingContext>, MethodTarget, ParameterTarget, ReturnValueConstraintMappingContext, TypeTarget

public final class ReturnValueConstraintMappingContextImpl
extends ConstraintMappingContextImplBase
implements ReturnValueConstraintMappingContext

Constraint mapping creational context which allows to configure the constraints for one method return value.

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

Field Summary
 
Fields inherited from class org.hibernate.validator.cfg.context.impl.ConstraintMappingContextImplBase
beanClass, mapping
 
Constructor Summary
ReturnValueConstraintMappingContextImpl(Class<?> beanClass, Method method, ConstraintMappingContext mapping)
           
 
Method Summary
 ReturnValueConstraintMappingContext constraint(ConstraintDef<?,?> definition)
          Adds a new constraint.
 ParameterConstraintMappingContext parameter(int index)
          Changes the parameter for which added constraints apply.
 ReturnValueConstraintMappingContext valid()
          Marks the current property as cascadable.
 
Methods inherited from class org.hibernate.validator.cfg.context.impl.ConstraintMappingContextImplBase
method, property, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.validator.cfg.context.TypeTarget
type
 
Methods inherited from interface org.hibernate.validator.cfg.context.MethodTarget
method
 

Constructor Detail

ReturnValueConstraintMappingContextImpl

public ReturnValueConstraintMappingContextImpl(Class<?> beanClass,
                                               Method method,
                                               ConstraintMappingContext mapping)
Method Detail

constraint

public ReturnValueConstraintMappingContext constraint(ConstraintDef<?,?> definition)
Description copied from interface: Constrainable
Adds a new constraint.

Specified by:
constraint in interface Constrainable<ReturnValueConstraintMappingContext>
Parameters:
definition - The constraint to add.
Returns:
The current creational context following the method chaining pattern.

valid

public ReturnValueConstraintMappingContext valid()
Marks the current property as cascadable.

Specified by:
valid in interface Cascadable<ReturnValueConstraintMappingContext>
Returns:
Returns itself for method chaining.

parameter

public ParameterConstraintMappingContext parameter(int index)
Changes the parameter for which added constraints apply.

Specified by:
parameter in interface ParameterTarget
Parameters:
index - The parameter index.
Returns:
Returns a new ConstraintsForTypeMethodElement instance allowing method chaining.


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