org.apache.myfaces.extensions.validator.core.validation.parameter
Class DefaultValidationParameterExtractor

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.validation.parameter.DefaultValidationParameterExtractor
All Implemented Interfaces:
ValidationParameterExtractor

public class DefaultValidationParameterExtractor
extends Object
implements ValidationParameterExtractor

Default implementation of the class which is capable of extracting ValidationParameter's from an annotation.

Since:
x.x.3
Author:
Gerhard Petracek

Field Summary
protected  Logger logger
           
 
Constructor Summary
DefaultValidationParameterExtractor()
           
 
Method Summary
 Map<Object,List<Object>> extract(Annotation annotation)
          Extracts all ValidationParameters hosted by the given annotation.
 List<Object> extract(Annotation annotation, Object key)
          Extracts all ValidationParameters for the given key which are hosted by the given annotation.
<T> List<T>
extract(Annotation annotation, Object key, Class<T> valueType)
          Extracts all ValidationParameters for the given key which are hosted by the given annotation.
<T> T
extract(Annotation annotation, Object key, Class<T> valueType, Class valueId)
          Extracts all ValidationParameters for the given key which are hosted by the given annotation.
 Map<Object,List<Object>> extractById(Annotation annotation, Class valueId)
           
 List<Object> extractById(Annotation annotation, Object key, Class valueId)
           
<T> List<T>
extractById(Annotation annotation, Object key, Class<T> valueType, Class valueId)
           
 
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

DefaultValidationParameterExtractor

public DefaultValidationParameterExtractor()
Method Detail

extract

public Map<Object,List<Object>> extract(Annotation annotation)
Description copied from interface: ValidationParameterExtractor
Extracts all ValidationParameters hosted by the given annotation. The wiki shows all supported styles.

Specified by:
extract in interface ValidationParameterExtractor
Parameters:
annotation - The annotation which might contain validation-parameters
Returns:
key/value map of the found parameters

extract

public List<Object> extract(Annotation annotation,
                            Object key)
Description copied from interface: ValidationParameterExtractor
Extracts all ValidationParameters for the given key which are hosted by the given annotation. The wiki shows all supported styles.

Specified by:
extract in interface ValidationParameterExtractor
Parameters:
annotation - The annotation for which we want to extract the information.
key - Value for the ParameterKey that is used for filtering the ValidationParameters.
Returns:
list of the found parameters

extract

public <T> List<T> extract(Annotation annotation,
                           Object key,
                           Class<T> valueType)
Description copied from interface: ValidationParameterExtractor
Extracts all ValidationParameters for the given key which are hosted by the given annotation. The result is filtered by the given type for the value. The wiki shows all supported styles.

Specified by:
extract in interface ValidationParameterExtractor
Type Parameters:
T - Class type of the result which is the same as the class type of the parameter valueType.
Parameters:
annotation - The annotation which might contain validation-parameters
key - Value for the ParameterKey that is used for filtering the ValidationParameters.
valueType - ParameterValue must be assignable to this type to be added to the result.
Returns:
list of the found parameters

extract

public <T> T extract(Annotation annotation,
                     Object key,
                     Class<T> valueType,
                     Class valueId)
Description copied from interface: ValidationParameterExtractor
Extracts all ValidationParameters for the given key which are hosted by the given annotation. The result is filtered by the given type for the value and the given id to receive a specific value if there are multiple parameters of the same type. The wiki shows all supported styles.

Specified by:
extract in interface ValidationParameterExtractor
Type Parameters:
T - Class type of the result which is the same as the class type of the parameter valueType.
Parameters:
annotation - The annotation which might contain validation-parameters
key - Value for the ParameterKey that is used for filtering the ValidationParameters.
valueType - ParameterValue must be assignable to this type to be added to the result.
valueId - marker which identifies a specific value (needed if there are multiple parameters of the same type)
Returns:
Value of the found ParameterValue.

extractById

public <T> List<T> extractById(Annotation annotation,
                               Object key,
                               Class<T> valueType,
                               Class valueId)

extractById

public List<Object> extractById(Annotation annotation,
                                Object key,
                                Class valueId)

extractById

public Map<Object,List<Object>> extractById(Annotation annotation,
                                            Class valueId)


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