myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Extensions/Validator/DevDoc" by GerhardPetracek
Date Thu, 10 Dec 2009 04:22:44 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The "Extensions/Validator/DevDoc" page has been changed by GerhardPetracek.
http://wiki.apache.org/myfaces/Extensions/Validator/DevDoc?action=diff&rev1=32&rev2=33

--------------------------------------------------

  
  {{{
  ExtValContext.getContext().denyRendererInterceptor(ValidationInterceptor.class);
- ExtValContext.getContext().registerRendererInterceptor(new ValidationInterceptorWithSkipValidationSupport());
//in versions < r3
+ //ExtValContext.getContext().registerRendererInterceptor(new ValidationInterceptorWithSkipValidationSupport());
//in versions < r3
  ExtValContext.getContext().registerRendererInterceptor(new PropertyValidationInterceptor());
//since r3
  }}}
+ 
+ since r3 the mechanism is more flexible and it's possible to register a custom implementation
of org.apache.myfaces.extensions.validator.core.validation.SkipValidationEvaluator
+ 
+ example for replacing the default evaluator within a startup listener:
+ {{{
+ ExtValContext.getContext().setSkipValidationEvaluator(new CustomValidationSkipValidationEvaluator());
+ }}}
+ 
  since extval follows the principle that there's no requirement for annotations the validation
strategy has to provide the information. annotate the validation strategy class with @SkipValidationSupport,
if it should be possible to skip the validation via @SkipValidation. if a condition of @SkipValidation
is true all following skip-able validation strategies (and also metadata transformer) are
skipped.
  
  implementation details: @SkipValidation also has a validation strategy. if the condition
is true the strategy adds an information to the current metadata entry that the validation
of further annotations should be skipped (if supported). that works because all metadata entries
for a property share the same information (of the property). so this information is available
for all following validations.

Mime
View raw message