public class SpecificElement extends java.lang.Object implements Element
specific
element.Constructor and Description |
---|
SpecificElement(Element element,
java.lang.Object target) |
Modifier and Type | Method and Description |
---|---|
java.lang.Class |
declaringClass() |
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> annotationClass) |
java.lang.annotation.Annotation[] |
getAnnotations() |
java.lang.annotation.Annotation[] |
getDeclaredAnnotations() |
ValueHandler |
in(java.lang.Object target)
Handles this element on the given target (if applies).
|
boolean |
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass) |
boolean |
isReadable() |
boolean |
isSpecific()
Checks if this element is specific for a target.
|
boolean |
isWritable() |
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() |
java.lang.Object |
value()
Returns the value if this element is
specific . |
public SpecificElement(Element element, java.lang.Object target)
element
- the specific element.target
- the target for this specific element.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 java.lang.Object value() throws HandlingException
Element
specific
.value
in interface Element
value
in interface ValueHandler
HandlingException
- if anything go wrong.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 java.lang.Class declaringClass()
declaringClass
in interface Element
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
getAnnotation
in interface java.lang.reflect.AnnotatedElement
public java.lang.annotation.Annotation[] getAnnotations()
getAnnotations
in interface java.lang.reflect.AnnotatedElement
public java.lang.annotation.Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations
in interface java.lang.reflect.AnnotatedElement
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
isAnnotationPresent
in interface java.lang.reflect.AnnotatedElement
public java.lang.String name()
public java.lang.Class type()
public ValueHandler in(java.lang.Object target)
Element
This method may throw exceptions in case of the element cannot be handled or an error occurring while handling the element.
in
in interface Element
in
in interface Result<ValueHandler,java.lang.Object>
target
- the target that contains this element.public boolean isReadable()
isReadable
in interface Element
true
if the value of this element can be read.public boolean isWritable()
isWritable
in interface Element
true
if the value of this element can be change.public java.lang.String toString()
toString
in class java.lang.Object