-
- All Implemented Interfaces:
-
dev.thecodewarrior.mirror.member.MemberMirror,dev.thecodewarrior.mirror.util.DeclarationMirror
public interface FieldMirror implements MemberMirror
A mirror representing a field.
-
-
Method Summary
Modifier and Type Method Description abstract <T extends Any> Tget(Object receiver)Get the value of this field in the passed instance. abstract Unitset(Object receiver, Object value)Set the value of this field in the passed instance. abstract FieldMirrorwithDeclaringClass(ClassMirror enclosing)Returns a copy of this member with its enclosing class replaced with enclosing. abstract FieldgetJava()The Core Reflection object this mirror represents abstract FieldMirrorgetRaw()The raw, unspecialized mirror of this field. abstract StringgetName()The field's name abstract BooleangetIsStatic()A shorthand for checking if the staticmodifier is present on this field.abstract BooleangetIsFinal()A shorthand for checking if the finalmodifier is present on this field.abstract BooleangetIsTransient()A shorthand for checking if the transientmodifier is present on this field.abstract BooleangetIsVolatile()A shorthand for checking if the volatilemodifier is present on this field.abstract BooleangetIsEnumConstant()True if this field holds an enum constant abstract TypeMirrorgetType()The field type, specialized based on the declaring class's specialization. abstract Set<Modifier>getModifiers()The set of modifiers present on this member. abstract Modifier.AccessgetAccess()The access control modifier for this member. abstract BooleangetIsPublic()A shorthand for checking if the publicmodifier is present on this field.abstract BooleangetIsProtected()A shorthand for checking if the protectedmodifier is present on this field.abstract BooleangetIsPrivate()A shorthand for checking if the privatemodifier is present on this field.abstract BooleangetIsPackagePrivate()A shorthand for checking if neither the public,protected, norprivatemodifiers are present on this field.abstract BooleangetIsSynthetic()Returns true if this member is synthetic. abstract BooleangetIsKotlinMember()Returns true if this member is declared in a class directly written in Kotlin abstract AnnotationListgetAnnotations()Returns annotations that are present on the member this mirror represents. abstract AnnotationListgetDeclaredAnnotations()Returns annotations that are declared on the member this mirror represents. abstract ClassMirrorgetDeclaringClass()The specialized class this member is declared in -
Methods inherited from class dev.thecodewarrior.mirror.member.FieldMirror
toString -
Methods inherited from class dev.thecodewarrior.mirror.member.MemberMirror
toDeclarationString, toJavaDeclarationString, toKotlinDeclarationString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
get
abstract <T extends Any> T get(Object receiver)
Get the value of this field in the passed instance. If this is a static field,
nullshould be used for the instance. After the one-time cost of creating the MethodHandle, the access should be near-native speed.
-
set
abstract Unit set(Object receiver, Object value)
Set the value of this field in the passed instance. If this is a static field,
nullshould be used for the instance. After the one-time cost of creating the MethodHandle, the access should be near-native speed.
-
withDeclaringClass
abstract FieldMirror withDeclaringClass(ClassMirror enclosing)
Returns a copy of this member with its enclosing class replaced with enclosing. Substituting type variables as necessary. If the passed class is null this method removes any enclosing class specialization.
Note: A new mirror is only created if none already exist with the required specialization
-
getRaw
abstract FieldMirror getRaw()
The raw, unspecialized mirror of this field.
-
getIsStatic
abstract Boolean getIsStatic()
A shorthand for checking if the
staticmodifier is present on this field.
-
getIsFinal
abstract Boolean getIsFinal()
A shorthand for checking if the
finalmodifier is present on this field.
-
getIsTransient
abstract Boolean getIsTransient()
A shorthand for checking if the
transientmodifier is present on this field.
-
getIsVolatile
abstract Boolean getIsVolatile()
A shorthand for checking if the
volatilemodifier is present on this field.
-
getIsEnumConstant
abstract Boolean getIsEnumConstant()
True if this field holds an enum constant
-
getType
abstract TypeMirror getType()
The field type, specialized based on the declaring class's specialization.
-
getModifiers
abstract Set<Modifier> getModifiers()
The set of modifiers present on this member. This set is in customary order, as defined in JLS §8.1.1
Note: This set is immutable
-
getAccess
abstract Modifier.Access getAccess()
The access control modifier for this member.
-
getIsPublic
abstract Boolean getIsPublic()
A shorthand for checking if the
publicmodifier is present on this field.
-
getIsProtected
abstract Boolean getIsProtected()
A shorthand for checking if the
protectedmodifier is present on this field.
-
getIsPrivate
abstract Boolean getIsPrivate()
A shorthand for checking if the
privatemodifier is present on this field.
-
getIsPackagePrivate
abstract Boolean getIsPackagePrivate()
A shorthand for checking if neither the
public,protected, norprivatemodifiers are present on this field.
-
getIsSynthetic
abstract Boolean getIsSynthetic()
Returns true if this member is synthetic.
-
getIsKotlinMember
abstract Boolean getIsKotlinMember()
Returns true if this member is declared in a class directly written in Kotlin
-
getAnnotations
abstract AnnotationList getAnnotations()
Returns annotations that are present on the member this mirror represents.
-
getDeclaredAnnotations
abstract AnnotationList getDeclaredAnnotations()
Returns annotations that are declared on the member this mirror represents.
-
getDeclaringClass
abstract ClassMirror getDeclaringClass()
The specialized class this member is declared in
-
-
-
-