class Element
extends java.lang.reflect.AccessibleObject
implements java.lang.reflect.Member
Field
, a Method
or a Constructor
.
Provides convenience methods such as isPublic()
and isPackagePrivate()
.Modifier and Type | Field and Description |
---|---|
private java.lang.reflect.AccessibleObject |
accessibleObject |
private java.lang.reflect.Member |
member |
Constructor and Description |
---|
Element(M member) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> annotationClass) |
java.lang.annotation.Annotation[] |
getAnnotations() |
java.lang.annotation.Annotation[] |
getDeclaredAnnotations() |
java.lang.Class<?> |
getDeclaringClass() |
int |
getModifiers() |
java.lang.String |
getName() |
TypeToken<?> |
getOwnerType() |
int |
hashCode() |
boolean |
isAbstract()
Returns true if the method is abstract.
|
boolean |
isAccessible() |
boolean |
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass) |
boolean |
isFinal()
Returns
true if this method is final, per Modifier.isFinal(getModifiers()) . |
boolean |
isNative()
Returns true if the element is native.
|
boolean |
isPackagePrivate()
Returns true if the element is package-private.
|
boolean |
isPrivate()
Returns true if the element is private.
|
boolean |
isProtected()
Returns true if the element is protected.
|
boolean |
isPublic()
Returns true if the element is public.
|
boolean |
isStatic()
Returns true if the element is static.
|
boolean |
isSynchronized()
Returns true if the method is synchronized.
|
boolean |
isSynthetic() |
(package private) boolean |
isTransient()
Returns true if the field is transient.
|
(package private) boolean |
isVolatile()
Returns true if the field is volatile.
|
void |
setAccessible(boolean flag) |
java.lang.String |
toString() |
private final java.lang.reflect.AccessibleObject accessibleObject
private final java.lang.reflect.Member member
public TypeToken<?> getOwnerType()
public final boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
isAnnotationPresent
in interface java.lang.reflect.AnnotatedElement
isAnnotationPresent
in class java.lang.reflect.AccessibleObject
public final <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationClass)
getAnnotation
in interface java.lang.reflect.AnnotatedElement
getAnnotation
in class java.lang.reflect.AccessibleObject
public final java.lang.annotation.Annotation[] getAnnotations()
getAnnotations
in interface java.lang.reflect.AnnotatedElement
getAnnotations
in class java.lang.reflect.AccessibleObject
public final java.lang.annotation.Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations
in interface java.lang.reflect.AnnotatedElement
getDeclaredAnnotations
in class java.lang.reflect.AccessibleObject
public final void setAccessible(boolean flag) throws java.lang.SecurityException
setAccessible
in class java.lang.reflect.AccessibleObject
java.lang.SecurityException
public final boolean isAccessible()
isAccessible
in class java.lang.reflect.AccessibleObject
public java.lang.Class<?> getDeclaringClass()
getDeclaringClass
in interface java.lang.reflect.Member
public final java.lang.String getName()
getName
in interface java.lang.reflect.Member
public final int getModifiers()
getModifiers
in interface java.lang.reflect.Member
public final boolean isSynthetic()
isSynthetic
in interface java.lang.reflect.Member
public final boolean isPublic()
public final boolean isProtected()
public final boolean isPackagePrivate()
public final boolean isPrivate()
public final boolean isStatic()
public final boolean isFinal()
true
if this method is final, per Modifier.isFinal(getModifiers())
.
Note that a method may still be effectively "final", or non-overridable when it has no
final
keyword. For example, it could be private, or it could be declared by a final
class. To tell whether a method is overridable, use Invokable.isOverridable()
.
public final boolean isAbstract()
public final boolean isNative()
public final boolean isSynchronized()
final boolean isVolatile()
final boolean isTransient()
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object