Package org.apache.xbean.finder
Class MetaAnnotatedElement<T extends java.lang.reflect.AnnotatedElement>
- java.lang.Object
-
- org.apache.xbean.finder.MetaAnnotatedElement<T>
-
- All Implemented Interfaces:
java.lang.reflect.AnnotatedElement
,Annotated<T>
,MetaAnnotated<T>
- Direct Known Subclasses:
MetaAnnotatedClass
,MetaAnnotatedConstructor
,MetaAnnotatedField
,MetaAnnotatedMethod
public class MetaAnnotatedElement<T extends java.lang.reflect.AnnotatedElement> extends java.lang.Object implements java.lang.reflect.AnnotatedElement, MetaAnnotated<T>
- Version:
- $Rev$ $Date$
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>>
annotations
protected T
target
-
Constructor Summary
Constructors Constructor Description MetaAnnotatedElement(T element)
MetaAnnotatedElement(T target, java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>> annotations)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static boolean
contains(java.lang.annotation.Annotation[] annotations, java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
boolean
equals(java.lang.Object obj)
T
get()
<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)
java.lang.annotation.Annotation[]
getAnnotations()
java.lang.annotation.Annotation[]
getDeclaredAnnotations()
private static java.util.Collection<java.lang.annotation.Annotation>
getDeclaredMetaAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
java.util.Collection<MetaAnnotation<?>>
getMetaAnnotations()
private static java.lang.Class<? extends java.lang.annotation.Annotation>
getMetatype(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
int
hashCode()
boolean
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
private static boolean
isMetaAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
private static boolean
isMetatypeAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> type)
private static boolean
isSelfAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation> type, java.lang.String name)
java.lang.String
toString()
protected static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>>
unroll(java.lang.annotation.Annotation[] annotations)
private static void
unroll(java.lang.Class<? extends java.lang.annotation.Annotation> clazz, int depth, java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>> found)
protected static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>>
unroll(java.lang.reflect.AnnotatedElement element)
protected java.lang.annotation.Annotation[][]
unrollParameters(java.lang.annotation.Annotation[][] parameterAnnotations)
private static boolean
validTarget(java.lang.Class<? extends java.lang.annotation.Annotation> type)
-
-
-
Field Detail
-
annotations
protected final java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>> annotations
-
target
protected final T extends java.lang.reflect.AnnotatedElement target
-
-
Constructor Detail
-
MetaAnnotatedElement
public MetaAnnotatedElement(T element)
-
MetaAnnotatedElement
MetaAnnotatedElement(T target, java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>> annotations)
-
-
Method Detail
-
get
public T get()
-
getDeclaredAnnotations
public java.lang.annotation.Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotations
in interfacejava.lang.reflect.AnnotatedElement
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Specified by:
isAnnotationPresent
in interfacejava.lang.reflect.AnnotatedElement
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotation
in interfacejava.lang.reflect.AnnotatedElement
-
getAnnotations
public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotations
in interfacejava.lang.reflect.AnnotatedElement
-
getMetaAnnotations
public java.util.Collection<MetaAnnotation<?>> getMetaAnnotations()
- Specified by:
getMetaAnnotations
in interfaceMetaAnnotated<T extends java.lang.reflect.AnnotatedElement>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
unroll
private static void unroll(java.lang.Class<? extends java.lang.annotation.Annotation> clazz, int depth, java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>> found)
-
getDeclaredMetaAnnotations
private static java.util.Collection<java.lang.annotation.Annotation> getDeclaredMetaAnnotations(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
-
contains
private static boolean contains(java.lang.annotation.Annotation[] annotations, java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
-
getMetatype
private static java.lang.Class<? extends java.lang.annotation.Annotation> getMetatype(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
-
isMetaAnnotation
private static boolean isMetaAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
-
isMetatypeAnnotation
private static boolean isMetatypeAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> type)
-
isSelfAnnotated
private static boolean isSelfAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation> type, java.lang.String name)
-
validTarget
private static boolean validTarget(java.lang.Class<? extends java.lang.annotation.Annotation> type)
-
unroll
protected static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>> unroll(java.lang.reflect.AnnotatedElement element)
-
unroll
protected static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,MetaAnnotation<?>> unroll(java.lang.annotation.Annotation[] annotations)
-
unrollParameters
protected java.lang.annotation.Annotation[][] unrollParameters(java.lang.annotation.Annotation[][] parameterAnnotations)
-
-