org.apache.myfaces.extensions.validator.core.validation.strategy
Class BeanValidationStrategyAdapterImpl

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.validation.strategy.BeanValidationStrategyAdapterImpl
All Implemented Interfaces:
BeanValidationStrategyAdapter, ValidationStrategy

public class BeanValidationStrategyAdapterImpl
extends Object
implements BeanValidationStrategyAdapter

Adapter to connect validation strategies with meta-data transformers, if the validation strategy is defined as bean and e.g. spring creates a proxy. it isn't linked to jsr 303. it's just a helper for proxies - you just need it, if you define the validation strategy as bean and e.g. spring creates a proxy for it.

Since:
1.x.1
Author:
Gerhard Petracek

Field Summary
protected  Logger logger
           
 
Constructor Summary
BeanValidationStrategyAdapterImpl()
           
 
Method Summary
 MetaDataTransformer getMetaDataTransformer()
           
 String getMetaDataTransformerClassName()
          Must return the class name of the MetaDataTransformer for the wrapped ValidationStrategy of the adapter.
 ValidationStrategy getValidationStrategy()
           
 String getValidationStrategyClassName()
          Must return the class name of ValidationStrategy wrapped by this adapter.
 void setMetaDataTransformer(MetaDataTransformer metaDataTransformer)
           
 void setValidationStrategy(ValidationStrategy validationStrategy)
          Sets the wrapped ValidationStrategy of this adapter.
 void setValidationStrategyClassName(String validationStrategyClassName)
          The class name returned by the {link getValidationStrategyClassName()} method when no ValidationStrategy is set.
 void validate(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, MetaDataEntry metaDataEntry, Object convertedObject)
          Validates the convertedObject against the given MetaDataEntry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Logger logger
Constructor Detail

BeanValidationStrategyAdapterImpl

public BeanValidationStrategyAdapterImpl()
Method Detail

validate

public void validate(javax.faces.context.FacesContext facesContext,
                     javax.faces.component.UIComponent uiComponent,
                     MetaDataEntry metaDataEntry,
                     Object convertedObject)
Validates the convertedObject against the given MetaDataEntry. Delegates to the validation to the wrapped ValidationStrategy.

Specified by:
validate in interface ValidationStrategy
Parameters:
facesContext - The JSF Context
uiComponent - The JSF component that contained the value entered by the user.
metaDataEntry - The data holder which stores the meta-data and some information where the meta-data was around.
convertedObject - Converted object of the user entered value.

getValidationStrategyClassName

public String getValidationStrategyClassName()
Description copied from interface: BeanValidationStrategyAdapter
Must return the class name of ValidationStrategy wrapped by this adapter.

Specified by:
getValidationStrategyClassName in interface BeanValidationStrategyAdapter
Returns:
class name of the wrapped ValidationStrategy

getMetaDataTransformerClassName

public String getMetaDataTransformerClassName()
Must return the class name of the MetaDataTransformer for the wrapped ValidationStrategy of the adapter. When a metaDataTransformer is set, the class name is returned. When the metaDataTransformer is an adapter (BeanMetaDataTransformerAdapter) we ask the adapter for the name.

Specified by:
getMetaDataTransformerClassName in interface BeanValidationStrategyAdapter
Returns:
class name of the MetaDataTransformer for the wrapped ValidationStrategy.

getMetaDataTransformer

public MetaDataTransformer getMetaDataTransformer()

setMetaDataTransformer

public void setMetaDataTransformer(MetaDataTransformer metaDataTransformer)

getValidationStrategy

public ValidationStrategy getValidationStrategy()

setValidationStrategy

public void setValidationStrategy(ValidationStrategy validationStrategy)
Sets the wrapped ValidationStrategy of this adapter.

Parameters:
validationStrategy - The ValidationStrategy to wrap by this adapter.

setValidationStrategyClassName

public void setValidationStrategyClassName(String validationStrategyClassName)
The class name returned by the {link getValidationStrategyClassName()} method when no ValidationStrategy is set.

Parameters:
validationStrategyClassName - The class name to return.


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.