public abstract class MetaField extends AbstractHasAnnotations implements MetaClassMember
Modifier and Type | Class and Description |
---|---|
static class |
MetaField.ArrayLengthMetaField
Special-purpose implementation of MetaField that represents the
length property of an array. |
Constructor and Description |
---|
MetaField() |
Modifier and Type | Method and Description |
---|---|
Field |
asField()
Returns the java.lang.reflect.Field object representing this MetaField.
|
boolean |
equals(Object o)
Compares this MetaField with another MetaField.
|
abstract Annotation[] |
getAnnotations()
Returns the annotations present on this field.
|
abstract MetaType |
getGenericType()
Returns the actual unerased type of this field, which could be a MetaClass
(class, enum, interface, array, primitive, etc), a bounded or unbounded
type variable, or a wildcard.
|
abstract String |
getName()
Returns this field's name without any type information or qualifiers.
|
abstract MetaClass |
getType()
Returns an actual MetaClass (a class, interface, primitive type, array, or
enum, but not a type variable or a wildcard) representing an erased
type that is assignable to this field.
|
int |
hashCode() |
String |
hashString()
Returns a string that uniquely identifies this field for purposes of
comparison with other implementations of
MetaField . |
String |
toString()
Returns a string which includes the declaring class's name and the field
type and field name, as well as all declared annotations for that field.
|
isAnnotationPresent
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDeclaringClass, getDeclaringClassName, isAbstract, isFinal, isPrivate, isProtected, isPublic, isStatic, isSynchronized, isSynthetic, isTransient, isVolatile
getAnnotation, isAnnotationPresent
public abstract MetaClass getType()
getGenericType()
public abstract MetaType getGenericType()
getType()
, any type
parameters on the field's type will be preserved in the returned MetaType
object.public abstract String getName()
getName
in interface MetaClassMember
public abstract Annotation[] getAnnotations()
getAnnotations
in interface HasAnnotations
public String toString()
public String hashString()
MetaField
. The returned
string includes the declaring class name, the field name, and the field's
type.public boolean equals(Object o)
public Field asField()
IllegalStateException
- if the field or its containing class cannot be located using Java
Reflection.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.