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

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

public final class ParameterConstraintMappingContextImpl
extends ConstraintMappingContextImplBase
implements ParameterConstraintMappingContext

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

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
ParameterConstraintMappingContextImpl(Class<?> beanClass, Method method, int parameterIndex, ConstraintMappingContext mapping)
           
 
Method Summary
 ParameterConstraintMappingContext constraint(ConstraintDef<?,?> definition)
          Adds a new constraint.
 ParameterConstraintMappingContext parameter(int index)
          Changes the parameter for which added constraints apply.
 ReturnValueConstraintMappingContext returnValue()
          Defines constraints on the return value of the current method.
 ParameterConstraintMappingContext valid()
          Marks the currently selected method parameter 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

ParameterConstraintMappingContextImpl

public ParameterConstraintMappingContextImpl(Class<?> beanClass,
                                             Method method,
                                             int parameterIndex,
                                             ConstraintMappingContext mapping)
Method Detail

constraint

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

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

valid

public ParameterConstraintMappingContext valid()
Marks the currently selected method parameter as cascadable.

Specified by:
valid in interface Cascadable<ParameterConstraintMappingContext>
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.

returnValue

public ReturnValueConstraintMappingContext returnValue()
Defines constraints on the return value of the current method.

Specified by:
returnValue in interface ReturnValueTarget
Returns:
Returns a new ConstraintsForTypeMethodElement instance allowing method chaining.


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