org.javalid.core.cache
Class AnnotationClassCache

java.lang.Object
  extended by org.javalid.core.cache.AnnotationClassCache

public class AnnotationClassCache
extends java.lang.Object

This class stores the annotation cache for exactly one class.

Since:
1.2
Version:
1.0
Author:
M.Reuvers

Constructor Summary
AnnotationClassCache(java.lang.Class clazz, ValidateDefinition definition, boolean fieldsCached)
           
 
Method Summary
 void addAnnotationClassCache(java.lang.String className, AnnotationClassLevelCache cacheElement)
           
 void addAnnotationFieldCache(java.lang.String className, java.lang.reflect.Field field, AnnotationFieldCache cacheElement)
          Adds the field and the cache for it to this class cache.
 void addAnnotationMethodCache(java.lang.String className, java.lang.reflect.Method method, AnnotationMethodCache cacheElement)
          Adds the method and the cache for it to this class cache.
 java.util.Map<java.lang.reflect.Field,AnnotationCache> getAnnotationCacheFields(java.lang.String className)
           
 AnnotationBaseCache getAnnotationCacheForClass(java.lang.String className)
          Returns the classcache for given className (that which was found on the class exactly, no inherited stuff).
 java.util.Map<java.lang.reflect.Method,AnnotationCache> getAnnotationCacheMethods(java.lang.String className)
           
 java.util.List<java.lang.reflect.Field> getFieldsForClassName(java.lang.String className)
           
 java.util.List<java.lang.reflect.Method> getMethodsForClassName(java.lang.String className)
           
 ValidateDefinition getValidateDefinition()
           
 boolean isFieldsCached()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotationClassCache

public AnnotationClassCache(java.lang.Class clazz,
                            ValidateDefinition definition,
                            boolean fieldsCached)
Method Detail

isFieldsCached

public boolean isFieldsCached()

getValidateDefinition

public ValidateDefinition getValidateDefinition()

addAnnotationFieldCache

public void addAnnotationFieldCache(java.lang.String className,
                                    java.lang.reflect.Field field,
                                    AnnotationFieldCache cacheElement)
Adds the field and the cache for it to this class cache. If the field is already in cache it raises an exception.

Parameters:
field - The field to add
cacheElement - The cache element

getAnnotationCacheFields

public java.util.Map<java.lang.reflect.Field,AnnotationCache> getAnnotationCacheFields(java.lang.String className)

getFieldsForClassName

public java.util.List<java.lang.reflect.Field> getFieldsForClassName(java.lang.String className)

addAnnotationMethodCache

public void addAnnotationMethodCache(java.lang.String className,
                                     java.lang.reflect.Method method,
                                     AnnotationMethodCache cacheElement)
Adds the method and the cache for it to this class cache. If the method is already in cache it raises an exception

Parameters:
method - The method to add
cacheElement - The cache element

addAnnotationClassCache

public void addAnnotationClassCache(java.lang.String className,
                                    AnnotationClassLevelCache cacheElement)

getAnnotationCacheMethods

public java.util.Map<java.lang.reflect.Method,AnnotationCache> getAnnotationCacheMethods(java.lang.String className)

getMethodsForClassName

public java.util.List<java.lang.reflect.Method> getMethodsForClassName(java.lang.String className)

getAnnotationCacheForClass

public AnnotationBaseCache getAnnotationCacheForClass(java.lang.String className)
Returns the classcache for given className (that which was found on the class exactly, no inherited stuff).

Parameters:
className - The classname to look for
Returns:
Classcache for given className if found, null otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object