public abstract class AbstractClassInfoStrategy extends Object implements ClassInfoStrategy, ClassAttributeApprover
ClassInfoStrategy
This default implementation is based on field introspection.
| Modifier and Type | Field and Description |
|---|---|
private Set<Class<? extends Annotation>> |
excludedAnnotations
Set of annotations, which mark fields to be skipped from populating.
|
private Map<Class<?>,Set<String>> |
excludedFields
Set of fields, which mark fields to be skipped from populating.
|
private Map<Class<?>,List<Method>> |
extraMethods
Set of extra methods to execute.
|
| Constructor and Description |
|---|
AbstractClassInfoStrategy() |
| Modifier and Type | Method and Description |
|---|---|
AbstractClassInfoStrategy |
addExcludedAnnotation(Class<? extends Annotation> annotation)
Adds the specified
Annotation to set of excluded annotations,
if it is not already present. |
AbstractClassInfoStrategy |
addExcludedField(Class<?> pojoClass,
String fieldName)
Adds the specified field to set of excluded fields,
if it is not already present.
|
AbstractClassInfoStrategy |
addExtraMethod(Class<?> pojoClass,
String methodName,
Class<?>... methodArgs)
It adds an extra method to execute
|
boolean |
approve(ClassAttribute attribute)
Override this method to select or reject class attributes
|
ClassAttributeApprover |
getClassAttributeApprover(Class<?> pojoClass) |
ClassInfo |
getClassInfo(Class<?> pojoClass) |
Set<Class<? extends Annotation>> |
getExcludedAnnotations()
Identifies
Annotations for fields to be skipped. |
Set<String> |
getExcludedFields(Class<?> pojoClass)
Identifies fields to be skipped.
|
Collection<Method> |
getExtraMethods(Class<?> pojoClass)
It returns the collection of extra methods to execute.
|
AbstractClassInfoStrategy |
removeExcludedAnnotation(Class<? extends Annotation> annotation)
Removes the specified
Annotation from set of excluded annotations. |
AbstractClassInfoStrategy |
removeExcludedField(Class<?> pojoClass,
String fieldName)
Removes the field name from set of excluded fields.
|
private final Set<Class<? extends Annotation>> excludedAnnotations
private Map<Class<?>,Set<String>> excludedFields
public AbstractClassInfoStrategy addExcludedAnnotation(Class<? extends Annotation> annotation)
Annotation to set of excluded annotations,
if it is not already present.annotation - the annotation to use as an exclusion markpublic AbstractClassInfoStrategy addExtraMethod(Class<?> pojoClass, String methodName, Class<?>... methodArgs) throws NoSuchMethodException, SecurityException
pojoClass - The pojo class where to execute the methodmethodName - name to be scheduled for executionmethodArgs - list of method argumentsSecurityException - If a security exception occurred while retrieving the methodNoSuchMethodException - If pojoClass doesn't declare the required methodpublic AbstractClassInfoStrategy removeExcludedAnnotation(Class<? extends Annotation> annotation)
Annotation from set of excluded annotations.annotation - the annotation used as an exclusion markpublic AbstractClassInfoStrategy addExcludedField(Class<?> pojoClass, String fieldName)
pojoClass - a class for which fields should be skippedfieldName - the field name to use as an exclusion markpublic AbstractClassInfoStrategy removeExcludedField(Class<?> pojoClass, String fieldName)
pojoClass - a class for which fields should be skippedfieldName - the field name used as an exlusion markpublic boolean approve(ClassAttribute attribute)
approve in interface ClassAttributeApproverattribute - class attribute to analyze for further processing or skippingpublic Set<Class<? extends Annotation>> getExcludedAnnotations()
Annotations for fields to be skipped.
Should return set of annotations, which will be treated as notion for
PodamFactory to skip production of these particular fields.
getExcludedAnnotations in interface ClassInfoStrategypublic Set<String> getExcludedFields(Class<?> pojoClass)
Should return set of field names as case-sensitive string, which will
be treated as notion for PodamFactory to skip production of
these particular fields.
getExcludedFields in interface ClassInfoStrategypojoClass - a class for which fields should be skippedpublic ClassInfo getClassInfo(Class<?> pojoClass)
getClassInfo in interface ClassInfoStrategypojoClass - a class to introspect and fetch attributesClassInfopublic ClassAttributeApprover getClassAttributeApprover(Class<?> pojoClass)
getClassAttributeApprover in interface ClassInfoStrategypublic Collection<Method> getExtraMethods(Class<?> pojoClass)
ClassInfoStrategygetExtraMethods in interface ClassInfoStrategypojoClass - The pojo classCopyright © 2015. All rights reserved.