|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jsefa.common.annotation.AnnotationDataProvider
public final class AnnotationDataProvider
Provider for values of annotation parameters. It provides a simple solution to the following drawbacks of
annotations:
1) Annotations can not extend an interface so that it is not possible to express that several annotations do
provide the same kind of data.
2) Annotated parameter values can not be set to null.
Method Summary | ||
---|---|---|
static
|
get(AnnotatedElement annotatedElement,
String annotationParameterName,
Class<? extends Annotation>... annotationClasses)
Returns the value of the annotation parameter with the given name of the annotation the given annotatedElement is annotated with and which class is one of the given annotation classes. |
|
static
|
get(Annotation annotation,
String annotationParameterName)
Returns the value of the annotation parameter with the given name of the given annotation or null if it is to be interpreted as null (as the empty String , an empty array or special classes used as
defaults for the annotation parameter value). |
|
static boolean |
hasParameter(Class<? extends Annotation> annotationClass,
String annotationParameterName)
Returns true if the annotation class has an annotation parameter with the given name; false otherwise. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> T get(Annotation annotation, String annotationParameterName)
String
, an empty array or special classes used as
defaults for the annotation parameter value).
T
- the expected type of the data to returnannotation
- the annotationannotationParameterName
- the annotation parameter name
public static <T> T get(AnnotatedElement annotatedElement, String annotationParameterName, Class<? extends Annotation>... annotationClasses)
String
or special
classes used as defaults for the annotation parameter value).
T
- the expected type of the returned dataannotatedElement
- the annotated elementannotationParameterName
- the name of the annotation parameterannotationClasses
- the annotation classes
public static boolean hasParameter(Class<? extends Annotation> annotationClass, String annotationParameterName)
annotationClass
- the annotation classannotationParameterName
- the annotation parameter name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |