@BeanIgnore public final class FieldInfo extends Object implements Comparable<FieldInfo>
Modifier | Constructor and Description |
---|---|
protected |
FieldInfo(ClassInfo declaringClass,
Field f)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(FieldInfo o) |
<T extends Annotation> |
getAnnotation(Class<T> a)
Returns the specified annotation on this field.
|
<T extends Annotation> |
getAnnotation(Class<T> a,
MetaProvider mp)
Returns the specified annotation on this field.
|
ClassInfo |
getDeclaringClass()
Returns metadata about the declaring class.
|
String |
getName()
Returns the name of this field.
|
ClassInfo |
getType()
Returns the type of this field.
|
boolean |
hasAnnotation(Class<? extends Annotation> a)
Returns
|
boolean |
hasAnnotation(Class<? extends Annotation> a,
MetaProvider mp)
Returns
|
boolean |
hasName(String name)
Returns
|
Field |
inner()
Returns the wrapped field.
|
boolean |
isAll(ReflectFlags... flags)
Returns
|
boolean |
isAny(ReflectFlags... flags)
Returns
|
boolean |
isDeprecated()
Returns
@Deprecated annotation on it. |
boolean |
isNotDeprecated()
Returns
@Deprecated annotation on it. |
boolean |
isNotPublic()
Returns
|
boolean |
isNotStatic()
Returns
|
boolean |
isNotTransient()
Returns
|
boolean |
isPublic()
Returns
|
boolean |
isStatic()
Returns
|
boolean |
isTransient()
Returns
|
boolean |
isVisible(Visibility v)
Identifies if the specified visibility matches this field.
|
static FieldInfo |
of(ClassInfo declaringClass,
Field f)
Convenience method for instantiating a
FieldInfo ; |
static FieldInfo |
of(Field f)
Convenience method for instantiating a
FieldInfo ; |
boolean |
setAccessible()
Attempts to call
x.setAccessible( and quietly ignores security exceptions. |
String |
toString() |
public static FieldInfo of(ClassInfo declaringClass, Field f)
FieldInfo
;declaringClass
- The class that declares this method.f
- The field being wrapped.FieldInfo
object, or public static FieldInfo of(Field f)
FieldInfo
;f
- The field being wrapped.FieldInfo
object, or public ClassInfo getDeclaringClass()
public <T extends Annotation> T getAnnotation(Class<T> a)
a
- The annotation to look for.public <T extends Annotation> T getAnnotation(Class<T> a, MetaProvider mp)
a
- The annotation to look for.mp
- The meta provider for looking up annotations on reflection objects (classes, methods, fields, constructors).public boolean hasAnnotation(Class<? extends Annotation> a)
a
- The annotation to check for.public boolean hasAnnotation(Class<? extends Annotation> a, MetaProvider mp)
a
- The annotation to check for.mp
- The meta provider for looking up annotations on reflection objects (classes, methods, fields, constructors).public boolean isAll(ReflectFlags... flags)
flags
- The flags to test for.public boolean isAny(ReflectFlags... flags)
flags
- The flags to test for.public boolean isDeprecated()
@Deprecated
annotation on it.@Deprecated
annotation on it.public boolean isNotDeprecated()
@Deprecated
annotation on it.@Deprecated
annotation on it.public boolean isPublic()
public boolean isNotPublic()
public boolean isStatic()
public boolean isNotStatic()
public boolean isTransient()
public boolean isNotTransient()
public boolean hasName(String name)
name
- The name to compare against.public boolean setAccessible()
x.setAccessible(true )
and quietly ignores security exceptions.public boolean isVisible(Visibility v)
v
- The visibility to validate against.public int compareTo(FieldInfo o)
compareTo
in interface Comparable<FieldInfo>
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.