org.jclouds.rest
Class InputParamValidator

java.lang.Object
  extended by org.jclouds.rest.InputParamValidator

public class InputParamValidator
extends Object

Validates method parameters. Checks the ParamValidators annotation for validators. There can be method-level validators that apply to all parameters, and parameter-level validators. When validation on at least one parameter doesn't pass, throws IllegalStateException.

Author:
Oleksiy Yarmula

Constructor Summary
InputParamValidator()
           
InputParamValidator(com.google.inject.Injector injector)
           
 
Method Summary
 void validateMethodParametersOrThrow(Method method, Object... args)
          Validates that method parameters are correct, according to ParamValidators.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputParamValidator

@Inject
public InputParamValidator(com.google.inject.Injector injector)

InputParamValidator

public InputParamValidator()
Method Detail

validateMethodParametersOrThrow

public void validateMethodParametersOrThrow(Method method,
                                            Object... args)
Validates that method parameters are correct, according to ParamValidators.

Parameters:
method - method with optionally set ParamValidators
args - method arguments with optionally set ParamValidators
Throws:
IllegalStateException - if validation failed
See Also:
ParamValidators, Validator


Copyright © 2009-2011 jclouds. All Rights Reserved.