org.nuiton.validator.xwork2
Class XWork2NuitonValidator<O>

java.lang.Object
  extended by org.nuiton.validator.xwork2.XWork2NuitonValidator<O>
All Implemented Interfaces:
NuitonValidator<O>

public class XWork2NuitonValidator<O>
extends Object
implements NuitonValidator<O>

Implementation of NuitonValidator using XWork2 validators.

Since:
2.0
Author:
tchemit

Field Summary
protected  NuitonValidatorModel<O> model
           
protected  Map<NuitonValidatorScope,XWork2ScopeValidator<O>> validators
          xworks scope validators *
 
Constructor Summary
XWork2NuitonValidator(NuitonValidatorModel<O> model)
           
 
Method Summary
 Set<String> getEffectiveFields()
          Obtains the set of effective fields for the validator : means the very fields validated by the validator.
 Set<String> getEffectiveFields(NuitonValidatorScope scope)
          Obtains the set of effective fields for the validator for the given scope : means the very fields validated by the validator.
 Set<NuitonValidatorScope> getEffectiveScopes()
          Obtains the set of effective scopes for the validator : means the very scopes that the validator is dealing with.
 NuitonValidatorModel<O> getModel()
          Obtains the model of the validator.
 NuitonValidatorResult validate(O object)
          Validates the given object and returns the result of validation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected NuitonValidatorModel<O> model

validators

protected Map<NuitonValidatorScope,XWork2ScopeValidator<O>> validators
xworks scope validators *

Constructor Detail

XWork2NuitonValidator

public XWork2NuitonValidator(NuitonValidatorModel<O> model)
Method Detail

validate

public NuitonValidatorResult validate(O object)
                               throws NullPointerException
Description copied from interface: NuitonValidator
Validates the given object and returns the result of validation.

Specified by:
validate in interface NuitonValidator<O>
Parameters:
object - the object to validate
Returns:
the result of validation for the given object
Throws:
NullPointerException - if object is null.

getEffectiveScopes

public Set<NuitonValidatorScope> getEffectiveScopes()
Description copied from interface: NuitonValidator
Obtains the set of effective scopes for the validator : means the very scopes that the validator is dealing with.

This is a subset of the model authorized scopes.

Specified by:
getEffectiveScopes in interface NuitonValidator<O>
Returns:
the set of effective scopes of the validator

getEffectiveFields

public Set<String> getEffectiveFields()
Description copied from interface: NuitonValidator
Obtains the set of effective fields for the validator : means the very fields validated by the validator. This is a sub set of fields of the object to validate.

Specified by:
getEffectiveFields in interface NuitonValidator<O>
Returns:
the set of effective fields of the validator

getEffectiveFields

public Set<String> getEffectiveFields(NuitonValidatorScope scope)
Description copied from interface: NuitonValidator
Obtains the set of effective fields for the validator for the given scope : means the very fields validated by the validator. This is a subset of effective fields of the validator.

Specified by:
getEffectiveFields in interface NuitonValidator<O>
Parameters:
scope - given scope to use
Returns:
the set of effective fields of the validator for the given scope

getModel

public NuitonValidatorModel<O> getModel()
Description copied from interface: NuitonValidator
Obtains the model of the validator.

Specified by:
getModel in interface NuitonValidator<O>
Returns:
the model of the validator


Copyright © 2011 CodeLutin. All Rights Reserved.