org.apache.myfaces.extensions.validator.core
Class ExtValCoreConfiguration

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration
All Implemented Interfaces:
ExtValModuleConfiguration
Direct Known Subclasses:
DefaultExtValCoreConfiguration

public abstract class ExtValCoreConfiguration
extends Object
implements ExtValModuleConfiguration

ExtVal Core Module configuration. 'custom' as prefix is used for 'optional' configurations. That means if a method returns null ExtVal uses a different approach to find an implementation e.g. via a naming convention -> all other methods aren't allowed to return null if there is no additional rule.

Since:
r4

Constructor Summary
protected ExtValCoreConfiguration()
           
 
Method Summary
abstract  boolean activateMarkupMetaData()
          Per default component initialization overrules properties of the component.
abstract  boolean activateRequiredInitialization()
          Indicates if the ComponentInitializer's should mark UIComponents as 'required' if an equivalent constraint is hosted by the referenced property.
abstract  Class<? extends Annotation> constraintSourceAnnotation()
          Returns a class of an annotation which should be used as ConstraintSource (use a custom implementation, if it is required to keep implementations independent of ExtVal)
abstract  String customBasePackage()
          Define a new base package where custom versions of the ExtVal artifacts can be found.
abstract  String customComponentInitializerClassName()
          Defines the name of a custom ComponentInitializer.
abstract  String customComponentMetaDataExtractorClassName()
          Defines the class name of a custom MetaDataExtractor.
abstract  String customComponentMetaDataExtractorFactoryClassName()
          Defines the name of a custom ComponentMetaDataExtractorFactory which creates MetaDataExtractors.
abstract  String customFacesMessageFactoryClassName()
          Defines the name of a custom FacesMessageFactory which creates and converts FacesMessages (Default implementation: DefaultValidationParameterExtractorFactory.)
abstract  String customInformationProviderBeanClassName()
          Defines the class name for a custom InformationProviderBean.
abstract  String customMessageBundleBaseName()
          The name of the Resource bundle used for looking up resource keys of validation messages.
abstract  String customMessageResolverFactoryClassName()
          Defines the name of a custom which is responsible for creating the MessageResolver for a given ValidationStrategy.
abstract  String customMetaDataExtractionInterceptorClassName()
          Defines the name of a custom MetaDataExtractionInterceptor.
abstract  String customMetaDataStorageFilterClassName()
          Defines the name of a custom MetaDataStorageFilter.
abstract  String customMetaDataToValidationStrategyNameMapperClassName()
          Defines the name of the custom NameMapper that takes a constraint-key and points to the ValidationStrategy that is linked to it.
abstract  String customMetaDataTransformerFactoryClassName()
          Defines the name of a custom which is responsible for creating a MetaDataTransformer for a given ValidationStrategy.
abstract  String customPropertyValidationInterceptorClassName()
          Defines the name of a custom PropertyValidationInterceptor.
abstract  String customStaticValidationStrategyMappingSource()
          Name of the optional property file which contains the mappings between ExtVal constraints and the ValidationStrategys for validating them.
abstract  String customStorageManagerFactoryClassName()
          Defines the name of a custom which is responsible for creating the StorageManager for a given storage class.
abstract  String customValidationExceptionInterceptorClassName()
          Defines the name of a custom ValidationExceptionInterceptor.
abstract  String customValidationParameterExtractorClassName()
          Defines the class name of a custom ValidationParameterExtractor.
abstract  String customValidationParameterExtractorFactoryClassName()
          Defines the name of a custom ValidationParameterExtractorFactory which creates ValidationParameterExtractors.
abstract  String customValidationParameterFactoryClassName()
          Defines the name of a custom which is responsible for creating the final Validation Parameter class.
abstract  String customValidationStrategyFactoryClassName()
          Defines the name of a custom which is responsible for creating a ValidationStrategy for a given metaData-key.
abstract  String customValidationStrategyToMessageResolverNameMapperClassName()
          Defines the name of a custom NameMapper that takes a ValidationStrategy and points to the MessageResolver that is linked to it.
abstract  String customValidationStrategyToMetaDataTransformerNameMapperClassName()
          Defines the name of the custom NameMapper that takes a ValidationStrategy and points to the MetaDataTransformer that is linked to it.
abstract  boolean deactivateComponentInitialization()
          Defines if the mechanism of component initialization (before the rendering process) should be deactivated.
abstract  boolean deactivateDefaultConvention()
          Indicates if ExtVal should deactivate the default convention.
abstract  boolean deactivateDefaultNameMappers()
          Indicates if ExtVal should deactivate all the internal defined name mappers.
abstract  boolean deactivateElResolver()
          Deprecated. 
abstract  boolean deactivateRenderKitFactory()
          Defines if the default entry point of ExtVal should be deactivated.
abstract  boolean deactivateRequiredAttributeSupport()
          Defines if ExtVal should reset the required attribute of a UIComponent after the decoding the component.
abstract  boolean deactivateValidationParameters()
          Defines if the mechanism of generic validation parameters should be deactivated.
abstract  Class<? extends ValidationParameter> disableClientSideValidationValidationParameter()
          Defines the validation parameter annotation which indicates that the validation information should not be transferred to the UIComponent.
static ExtValCoreConfiguration get()
          Returns the configuration for the core-module stored in the context.
abstract  Class<? extends Annotation> ignoreConstraintSourceAnnotation()
          Returns a class of an annotation which should be used as IgnoreConstraintSource (use a custom implementation, if it is required to keep implementations independent of ExtVal)
abstract  boolean interpretEmptyStringSubmittedValuesAsNull()
          Defines if ExtVal should convert empty strings to null (just for the validation process).
abstract  ProjectStageResolver projectStageResolver()
          Defines the ProjectStageResolver that should be used by ExtVal.
abstract  ProxyHelper proxyHelper()
          Defines the ProxyHelper that should be used by ExtVal.
abstract  Class<? extends ExtValRendererProxy> rendererProxy()
          Defines an optional RendererProxy that should be used by ExtVal.
abstract  Class<? extends Annotation> targetPropertyAnnotation()
          Returns a class of an annotation which should be used as TargetProperty (use a custom implementation, if it is required to keep implementations independent of ExtVal)
abstract  Class<? extends Annotation> targetPropertyIdAnnotation()
          Returns a class of an annotation which should be used as TargetPropertyId (use a custom implementation, if it is required to keep implementations independent of ExtVal)
static boolean use(ExtValCoreConfiguration config, boolean forceOverride)
          Sets a new configuration for the core-module
abstract  boolean validateEmptyFields()
          Defines if ExtVal should validate empty fields.
abstract  Class violationSeverity()
          Returns the class which should be used as violation severity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtValCoreConfiguration

protected ExtValCoreConfiguration()
Method Detail

get

public static ExtValCoreConfiguration get()
Returns the configuration for the core-module stored in the context. If this doesn't exists (usually a startup-listener registers a (custom) implementation), it returns a new instance of the default implementation.

Returns:
The active ExtVal Core Module Configuration

use

public static boolean use(ExtValCoreConfiguration config,
                          boolean forceOverride)
Sets a new configuration for the core-module

Parameters:
config - The new configuration for the core-module
forceOverride - use true to replace an existing configuration
Returns:
true if the new config was registered successfully

customMessageBundleBaseName

public abstract String customMessageBundleBaseName()
The name of the Resource bundle used for looking up resource keys of validation messages.

Returns:
Fully qualified name of a custom resource bundle.
See Also:
DefaultValidationErrorMessageResolver

customBasePackage

public abstract String customBasePackage()
Define a new base package where custom versions of the ExtVal artifacts can be found. (Default value: org.apache.myfaces.extensions.validator.custom)

Returns:
package name
See Also:
InformationProviderBean.setupCustomizableInformation()

customInformationProviderBeanClassName

public abstract String customInformationProviderBeanClassName()
Defines the class name for a custom InformationProviderBean. This class must extend InformationProviderBean.

Returns:
Fully qualified class name of the class to be used as InformationProviderBean

customComponentMetaDataExtractorClassName

public abstract String customComponentMetaDataExtractorClassName()
Defines the class name of a custom MetaDataExtractor. (Default implementation: DefaultComponentMetaDataExtractor).

Returns:
Fully qualified class name of the class to be used as MetaDataExtractor.
See Also:
org.apache.myfaces.extensions.validator.core.metadata.extractor.DefaultComponentMetaDataExtractorFactory#createWith(java.util.Map)

customValidationParameterExtractorClassName

public abstract String customValidationParameterExtractorClassName()
Defines the class name of a custom ValidationParameterExtractor. (Default implementation: DefaultValidationParameterExtractor.

Returns:
Fully qualified class name of the class to be used as {@link org.apache.myfaces.extensions.validator.core.validation.parameter.ValidationParameterExtractor).
See Also:
DefaultValidationParameterExtractorFactory.create()

customStaticValidationStrategyMappingSource

public abstract String customStaticValidationStrategyMappingSource()
Name of the optional property file which contains the mappings between ExtVal constraints and the ValidationStrategys for validating them. These mappings can be used to overrule all other configurations.

Returns:
Fully qualified name of the property file which contains the mappings.
See Also:
DefaultValidationStrategyFactory.initStaticMappings()

customComponentInitializerClassName

public abstract String customComponentInitializerClassName()
Defines the name of a custom ComponentInitializer.

Returns:
Fully qualified class name of the class to be used as ComponentInitializer.
See Also:
ExtValContextInvocationOrderAwareInternals.lazyInitComponentInitializers()

customValidationExceptionInterceptorClassName

public abstract String customValidationExceptionInterceptorClassName()
Defines the name of a custom ValidationExceptionInterceptor.

Returns:
Fully qualified class name of the class to be used as ValidationExceptionInterceptor.
See Also:
ExtValContextInvocationOrderAwareInternals.lazyInitValidationExceptionInterceptors()

customPropertyValidationInterceptorClassName

public abstract String customPropertyValidationInterceptorClassName()
Defines the name of a custom PropertyValidationInterceptor.

Returns:
Fully qualified class name of the class to be used as PropertyValidationInterceptor.
See Also:
ExtValContextInvocationOrderAwareInternals.lazyInitPropertyValidationInterceptors()

customMetaDataExtractionInterceptorClassName

public abstract String customMetaDataExtractionInterceptorClassName()
Defines the name of a custom MetaDataExtractionInterceptor.

Returns:
Fully qualified class name of the class to be used as MetaDataExtractionInterceptor.
See Also:
ExtValContextInvocationOrderAwareInternals.lazyInitMetaDataExtractionInterceptors()

proxyHelper

public abstract ProxyHelper proxyHelper()
Defines the ProxyHelper that should be used by ExtVal. (Default implementation: DefaultProxyHelper). The method should never return null.

Returns:
The instance of the ProxyHelper that should be used.
See Also:
ProxyUtils.getProxyHelper()

projectStageResolver

public abstract ProjectStageResolver projectStageResolver()
Defines the ProjectStageResolver that should be used by ExtVal. (Default implementation: DefaultProjectStageResolver If the method returns null, the project-stage 'Production' will be used.

Returns:
The instance of the ProjectStageResolver that should be used.
See Also:
ProjectStage.getCurrentProjectStage()

rendererProxy

public abstract Class<? extends ExtValRendererProxy> rendererProxy()
Defines an optional RendererProxy that should be used by ExtVal.

Returns:
The instance of the RendererProxy that should be used.
See Also:
ExtValLazyRendererProxy.getLazyRenderer(), ExtValRendererWrapper.ExtValRendererWrapper(javax.faces.render.Renderer)

constraintSourceAnnotation

public abstract Class<? extends Annotation> constraintSourceAnnotation()
Returns a class of an annotation which should be used as ConstraintSource (use a custom implementation, if it is required to keep implementations independent of ExtVal)

Returns:
Annotation class of the alternative implementation
See Also:
ConstraintSourceUtils.findMappedClass(org.apache.myfaces.extensions.validator.core.storage.PropertyStorage, java.lang.Class, java.lang.String)

ignoreConstraintSourceAnnotation

public abstract Class<? extends Annotation> ignoreConstraintSourceAnnotation()
Returns a class of an annotation which should be used as IgnoreConstraintSource (use a custom implementation, if it is required to keep implementations independent of ExtVal)

Returns:
Annotation class of the alternative implementation
See Also:
ConstraintSourceUtils.getIgnoreConstraintSourceAnnotationImplementation()

targetPropertyAnnotation

public abstract Class<? extends Annotation> targetPropertyAnnotation()
Returns a class of an annotation which should be used as TargetProperty (use a custom implementation, if it is required to keep implementations independent of ExtVal)

Returns:
Annotation class of the alternative implementation
See Also:
ConstraintSourceUtils.getTargetPropertyAnnotationImplementation()

targetPropertyIdAnnotation

public abstract Class<? extends Annotation> targetPropertyIdAnnotation()
Returns a class of an annotation which should be used as TargetPropertyId (use a custom implementation, if it is required to keep implementations independent of ExtVal)

Returns:
Annotation class of the alternative implementation
See Also:
ConstraintSourceUtils.getTargetPropertyIdAnnotationImplementation()

violationSeverity

public abstract Class violationSeverity()
Returns the class which should be used as violation severity. (Default implementation: ViolationSeverity).

Returns:
class which should be used as violation severity

disableClientSideValidationValidationParameter

public abstract Class<? extends ValidationParameter> disableClientSideValidationValidationParameter()
Defines the validation parameter annotation which indicates that the validation information should not be transferred to the UIComponent.

Returns:
Validation parameter annotation for indicating that no validation information needs to be set on the ui-component.
See Also:
ExtValStartupListener.initDisableClientSideValidationKey()

customValidationStrategyToMessageResolverNameMapperClassName

public abstract String customValidationStrategyToMessageResolverNameMapperClassName()
Defines the name of a custom NameMapper that takes a ValidationStrategy and points to the MessageResolver that is linked to it. (The class should implement the interface NameMapper.)

Returns:
fully qualified class name of the custom NameMapper to retrieve MessageResolver name for a given ValidationStrategy.
See Also:
CustomConfiguredValidationStrategyToMsgResolverNameMapper.getCustomNameMapperClassName()

customMetaDataToValidationStrategyNameMapperClassName

public abstract String customMetaDataToValidationStrategyNameMapperClassName()
Defines the name of the custom NameMapper that takes a constraint-key and points to the ValidationStrategy that is linked to it. (The class should implement the interface NameMapper.)

Returns:
fully qualified class name of the custom NameMapper to retrieve ValidationStrategy name for a given constraint-key.
See Also:
CustomConfiguredAnnotationToValidationStrategyNameMapper.CustomConfiguredAnnotationToValidationStrategyNameMapper()

customValidationStrategyToMetaDataTransformerNameMapperClassName

public abstract String customValidationStrategyToMetaDataTransformerNameMapperClassName()
Defines the name of the custom NameMapper that takes a ValidationStrategy and points to the MetaDataTransformer that is linked to it. (The class should implement the interface NameMapper.)

Returns:
fully qualified class name of the custom NameMapper to retrieve MetaDataTransformer name for a given ValidationStrategy.
See Also:
CustomConfiguredValidationStrategyToMetaDataTransformerNameMapper.getCustomNameMapperClassName()

customMetaDataStorageFilterClassName

public abstract String customMetaDataStorageFilterClassName()
Defines the name of a custom MetaDataStorageFilter.

Returns:
Fully qualified class name of the class to be used as MetaDataStorageFilter.
See Also:
DefaultMetaDataStorage.initFilters()

customValidationStrategyFactoryClassName

public abstract String customValidationStrategyFactoryClassName()
Defines the name of a custom which is responsible for creating a ValidationStrategy for a given metaData-key. (Default implementation: DefaultValidationStrategyFactory.)

Returns:
Fully qualified class name of the class to be used as ClassMappingFactory
See Also:
DefaultFactoryFinder.createValidationStrategyFactory()

customMessageResolverFactoryClassName

public abstract String customMessageResolverFactoryClassName()
Defines the name of a custom which is responsible for creating the MessageResolver for a given ValidationStrategy. (Default implementation: DefaultMessageResolverFactory.)

Returns:
Fully qualified class name of the class to be used as ClassMappingFactory
See Also:
DefaultFactoryFinder.createMessageResolverFactory()

customComponentMetaDataExtractorFactoryClassName

public abstract String customComponentMetaDataExtractorFactoryClassName()
Defines the name of a custom ComponentMetaDataExtractorFactory which creates MetaDataExtractors. (Default implementation: DefaultComponentMetaDataExtractorFactory .)

Returns:
Fully qualified class name of the class to be used as ComponentMetaDataExtractorFactory
See Also:
DefaultFactoryFinder.createComponentMetaDataExtractorFactory()

customValidationParameterExtractorFactoryClassName

public abstract String customValidationParameterExtractorFactoryClassName()
Defines the name of a custom ValidationParameterExtractorFactory which creates ValidationParameterExtractors. (Default implementation: DefaultValidationParameterExtractorFactory.)

Returns:
Fully qualified class name of the class to be used as ValidationParameterExtractorFactory
See Also:
DefaultFactoryFinder.createValidationParameterExtractorFactory()

customValidationParameterFactoryClassName

public abstract String customValidationParameterFactoryClassName()
Defines the name of a custom which is responsible for creating the final Validation Parameter class. (Default implementation: DefaultValidationParameterFactory.)

Returns:
Fully qualified class name of the class to be used as ClassMappingFactory
See Also:
DefaultFactoryFinder.createValidationParameterFactory()

customMetaDataTransformerFactoryClassName

public abstract String customMetaDataTransformerFactoryClassName()
Defines the name of a custom which is responsible for creating a MetaDataTransformer for a given ValidationStrategy. (Default implementation: DefaultMetaDataTransformerFactory.)

Returns:
Fully qualified class name of the class to be used as ClassMappingFactory
See Also:
DefaultFactoryFinder.createMetaDataTransformerFactory()

customStorageManagerFactoryClassName

public abstract String customStorageManagerFactoryClassName()
Defines the name of a custom which is responsible for creating the StorageManager for a given storage class. (Default implementation: DefaultStorageManagerFactory.)

Returns:
Fully qualified class name of implementation of a ClassMappingFactory.
See Also:
DefaultFactoryFinder.createStorageManagerFactory()

customFacesMessageFactoryClassName

public abstract String customFacesMessageFactoryClassName()
Defines the name of a custom FacesMessageFactory which creates and converts FacesMessages (Default implementation: DefaultValidationParameterExtractorFactory.)

Returns:
Fully qualified class name of the class to be used as FacesMessageFactory
See Also:
DefaultFactoryFinder.createFacesMessageFactory()

activateRequiredInitialization

public abstract boolean activateRequiredInitialization()
Indicates if the ComponentInitializer's should mark UIComponents as 'required' if an equivalent constraint is hosted by the referenced property.

Returns:
true if the required attribute should be honored, false otherwise.
See Also:
org.apache.myfaces.extensions.validator.core.initializer.component.AbstractHtmlCoreComponentsComponentInitializer#configureComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.util.Map)

deactivateDefaultConvention

public abstract boolean deactivateDefaultConvention()
Indicates if ExtVal should deactivate the default convention.

Returns:
true if the default convention should be deactivated, false otherwise

deactivateDefaultNameMappers

public abstract boolean deactivateDefaultNameMappers()
Indicates if ExtVal should deactivate all the internal defined name mappers. (Be aware that ExtVal will fail, if no alternatives are defined.)

Returns:
true when we want to deactivate internal defined name mappers.
See Also:
ExtValStartupListener.initNameMappers()

deactivateElResolver

@Deprecated
public abstract boolean deactivateElResolver()
Deprecated. 

Defines if ExtVal should fallback to an alternative (but deprecated) approach for inspecting EL-expressions.

Returns:
true when we want to deactivate internal EL Resolver.
See Also:
DefaultELHelper

deactivateComponentInitialization

public abstract boolean deactivateComponentInitialization()
Defines if the mechanism of component initialization (before the rendering process) should be deactivated.

Returns:
true if UIComponents should not be initialized by ExtVal, false otherwise.
See Also:
ExtValContextInternals.isComponentInitializationActivated(), AbstractValidationInterceptor.isComponentInitializationDeactivated()

deactivateValidationParameters

public abstract boolean deactivateValidationParameters()
Defines if the mechanism of generic validation parameters should be deactivated.

Returns:
true if validation parameter extraction should be skipped, false otherwise
See Also:
ExtValUtils.getValidationParameterExtractor()

deactivateRenderKitFactory

public abstract boolean deactivateRenderKitFactory()
Defines if the default entry point of ExtVal should be deactivated. (Attention: in case of mojarra you have to use the vm-parameter: org.apache.myfaces.extensions.validator.DEACTIVATE_RENDER_KIT_FACTORY)

Returns:
true for deactivating ExtVal, false otherwise
See Also:
ExtValRenderKitFactory.checkRenderKitFactoryDeactivation()

deactivateRequiredAttributeSupport

public abstract boolean deactivateRequiredAttributeSupport()
Defines if ExtVal should reset the required attribute of a UIComponent after the decoding the component. (It's needed for special use-cases.)

Returns:
true if ExtVal should set the required attribute to false, false otherwise
See Also:
ExtValUtils.isRequiredResetActivated()

interpretEmptyStringSubmittedValuesAsNull

public abstract boolean interpretEmptyStringSubmittedValuesAsNull()
Defines if ExtVal should convert empty strings to null (just for the validation process). (Introduced by JSF 2.0) Compared to std. JSF it's activated by default!

Returns:
false for using the default behavior of JSF 2.0

validateEmptyFields

public abstract boolean validateEmptyFields()
Defines if ExtVal should validate empty fields. Please also have a look at the NullValueAwareValidationStrategy annotation. (Introduced by JSF 2.0) Compared to std. JSF it's activated by default!

Returns:
false for using the default behavior of JSF 2.0

activateMarkupMetaData

public abstract boolean activateMarkupMetaData()
Per default component initialization overrules properties of the component. With activating markup meta-data it's possible to overrule the meta-data of the constraints with the meta-data of the component.

Returns:
true to overrule constraint meta-data with meta-data provided by the component, false otherwise


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