public abstract class AbstractElement extends java.lang.Object implements Element
Modifier and Type | Field and Description |
---|---|
protected java.lang.reflect.AnnotatedElement |
annotatedElement
The element for retrieving annotation metadata.
|
protected java.lang.String |
name
The element name
|
Constructor and Description |
---|
AbstractElement(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> annotationClass) |
java.lang.annotation.Annotation[] |
getAnnotations() |
java.lang.annotation.Annotation[] |
getDeclaredAnnotations() |
boolean |
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass) |
boolean |
isSpecific()
Checks if this element is specific for a target.
|
java.lang.String |
name() |
void |
set(java.lang.Object value)
Sets the value if this element is
specific . |
<E> E |
target()
Returns the target for this element in case of a
specific one. |
java.lang.String |
toString() |
java.lang.Class<?> |
type() |
<E> E |
value()
Returns the value if this element is
specific . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
declaringClass, in, isReadable, isWritable
protected java.lang.reflect.AnnotatedElement annotatedElement
protected final java.lang.String name
public AbstractElement(java.lang.String name)
name
- the element namepublic final java.lang.String name()
public java.lang.Class<?> type()
public final <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
getAnnotation
in interface java.lang.reflect.AnnotatedElement
public final java.lang.annotation.Annotation[] getAnnotations()
getAnnotations
in interface java.lang.reflect.AnnotatedElement
public final java.lang.annotation.Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations
in interface java.lang.reflect.AnnotatedElement
public final boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
isAnnotationPresent
in interface java.lang.reflect.AnnotatedElement
public boolean isSpecific()
Element
true
, then the methods Element.value()
and
Element.set(Object)
can be used.isSpecific
in interface Element
true
if this element is specific for a target.public <E> E target()
Element
specific
one.public void set(java.lang.Object value) throws HandlingException
Element
specific
.set
in interface Element
set
in interface ValueHandler
value
- the value to set.HandlingException
- if anything go wrongpublic <E> E value() throws HandlingException
Element
specific
.value
in interface Element
value
in interface ValueHandler
HandlingException
- if anything go wrong.public java.lang.String toString()
toString
in class java.lang.Object