public final class AnnotationMember extends Object implements Serializable
AnnotationFactory,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected static char |
ARRAY
Tag description of an array value type.
|
protected Method |
definingMethod |
protected Class<?> |
elementType |
protected static char |
ERROR
Tag description of a Throwable value type.
|
protected String |
name |
protected static Object |
NO_VALUE
Singleton representing missing element value.
|
protected static char |
OTHER
Tag description of all value types except arrays and Throwables.
|
protected char |
tag |
protected Object |
value |
| Constructor and Description |
|---|
AnnotationMember(String name,
Object val)
Creates a new element with specified name and value.
|
AnnotationMember(String name,
Object val,
Class type,
Method m)
Creates the completely defined element.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
copyValue()
Provides mutation-safe access to contained value.
|
boolean |
equalArrayValue(Object otherValue)
Returns true if the contained value and a passed object are equal arrays,
false otherwise.
|
boolean |
equals(Object obj)
Returns true if the specified object represents equal element
(equivalent name-value pair).
|
int |
hashCode()
Computes hash code of this element.
|
void |
rethrowError()
Throws contained error (if any) with a renewed stack trace.
|
protected AnnotationMember |
setDefinition(AnnotationMember copy)
Fills in element's definition info and returns this.
|
String |
toString()
Returns readable description of this annotation value.
|
Object |
validateValue()
Validates contained value against its member definition
and if ok returns the value.
|
protected static final char ERROR
protected static final char ARRAY
protected static final char OTHER
protected static final Object NO_VALUE
protected final String name
protected final Object value
protected final char tag
protected transient Class<?> elementType
protected transient Method definingMethod
public AnnotationMember(String name, Object val)
name - element name, must not be nullval - element value, should be of addmissible type,
as specified in the description of this classsetDefinition(AnnotationMember)public AnnotationMember(String name, Object val, Class type, Method m)
name - element name, must not be nullvalue - element value, should be of addmissible type,
as specified in the description of this classm - element-defining method, reflected on the annotation typetype - declared type of this element
(return type of the defining method)protected AnnotationMember setDefinition(AnnotationMember copy)
public String toString()
public boolean equals(Object obj)
equals in class Objectobj - the object to compare this instance with.equalArrayValue(Object),
Annotation.equals(Object)public boolean equalArrayValue(Object otherValue)
Arrays.equals(java.lang.Object[], java.lang.Object[])public int hashCode()
(name.hashCode() * 127) ^ value.hashCode()
hashCode in class ObjectArrays.hashCode(java.lang.Object[]),
Annotation.hashCode()public void rethrowError()
throws Throwable
Throwablepublic Object validateValue() throws Throwable
ThrowablerethrowError(),
copyValue()