Package org.ehcache.sizeof.filters
Class AnnotationSizeOfFilter
- java.lang.Object
-
- org.ehcache.sizeof.filters.AnnotationSizeOfFilter
-
- All Implemented Interfaces:
SizeOfFilter
public final class AnnotationSizeOfFilter extends java.lang.Object implements SizeOfFilter
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringIGNORE_SIZE_OF_DEFAULT_REGEXPprivate static java.util.regex.PatternIGNORE_SIZE_OF_PATTERNprivate static java.lang.StringIGNORE_SIZE_OF_VM_ARGUMENTprivate static org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description AnnotationSizeOfFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanfilterClass(java.lang.Class<?> klazz)Checks whether the type needs to be filteredjava.util.Collection<java.lang.reflect.Field>filterFields(java.lang.Class<?> klazz, java.util.Collection<java.lang.reflect.Field> fields)Returns the fields to walk and measure for a typeprivate <T extends java.lang.annotation.Annotation>
TgetAnnotationOn(java.lang.reflect.AnnotatedElement element, java.lang.Class<T> referenceAnnotation, java.util.regex.Pattern matchingAnnotationPattern)private booleanisAnnotationPresentOrInherited(java.lang.Class<?> instanceKlazz)private booleanvalidateCustomAnnotationPattern(java.lang.String canonicalName, java.util.regex.Pattern matchingAnnotationPattern)
-
-
-
Field Detail
-
IGNORE_SIZE_OF_VM_ARGUMENT
private static final java.lang.String IGNORE_SIZE_OF_VM_ARGUMENT
-
LOG
private static final org.slf4j.Logger LOG
-
IGNORE_SIZE_OF_DEFAULT_REGEXP
private static final java.lang.String IGNORE_SIZE_OF_DEFAULT_REGEXP
- See Also:
- Constant Field Values
-
IGNORE_SIZE_OF_PATTERN
private static final java.util.regex.Pattern IGNORE_SIZE_OF_PATTERN
-
-
Method Detail
-
filterFields
public java.util.Collection<java.lang.reflect.Field> filterFields(java.lang.Class<?> klazz, java.util.Collection<java.lang.reflect.Field> fields)Returns the fields to walk and measure for a type- Specified by:
filterFieldsin interfaceSizeOfFilter- Parameters:
klazz- the typefields- the fields already "qualified"- Returns:
- the filtered Set
-
filterClass
public boolean filterClass(java.lang.Class<?> klazz)
Checks whether the type needs to be filtered- Specified by:
filterClassin interfaceSizeOfFilter- Parameters:
klazz- the type- Returns:
- true, if to be filtered out
-
isAnnotationPresentOrInherited
private boolean isAnnotationPresentOrInherited(java.lang.Class<?> instanceKlazz)
-
validateCustomAnnotationPattern
private boolean validateCustomAnnotationPattern(java.lang.String canonicalName, java.util.regex.Pattern matchingAnnotationPattern)
-
getAnnotationOn
private <T extends java.lang.annotation.Annotation> T getAnnotationOn(java.lang.reflect.AnnotatedElement element, java.lang.Class<T> referenceAnnotation, java.util.regex.Pattern matchingAnnotationPattern)
-
-