Package org.codehaus.janino
Class ReflectionIClass.ReflectionIField
- java.lang.Object
-
- org.codehaus.janino.IClass.IField
-
- org.codehaus.janino.ReflectionIClass.ReflectionIField
-
- All Implemented Interfaces:
IClass.IMember
- Enclosing class:
- ReflectionIClass
private class ReflectionIClass.ReflectionIField extends IClass.IField
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.reflect.Field
field
-
Constructor Summary
Constructors Constructor Description ReflectionIField(java.lang.reflect.Field field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Access
getAccess()
IClass.IAnnotation[]
getAnnotations()
java.lang.Object
getConstantValue()
This implementation ofIClass.IField.getConstantValue()
is not completely correct: It treats non-static fields as non-constant Even fields with a non-constant initializer are identified as constant.java.lang.String
getName()
IClass
getType()
boolean
isStatic()
java.lang.String
toString()
-
Methods inherited from class org.codehaus.janino.IClass.IField
getDeclaringIClass, getDescriptor
-
-
-
-
Method Detail
-
getAccess
public Access getAccess()
- Specified by:
getAccess
in interfaceIClass.IMember
- Specified by:
getAccess
in classIClass.IField
- Returns:
- One of
Access.PRIVATE
,Access.PROTECTED
,Access.DEFAULT
andAccess.PUBLIC
.
-
getAnnotations
public IClass.IAnnotation[] getAnnotations()
- Returns:
- Modifiers and/or annotations of this member
-
getName
public java.lang.String getName()
- Specified by:
getName
in classIClass.IField
- Returns:
- The name this field
-
isStatic
public boolean isStatic()
- Specified by:
isStatic
in classIClass.IField
- Returns:
- Whether this field is STATIC
-
getType
public IClass getType()
- Specified by:
getType
in classIClass.IField
- Returns:
- The type of this field
-
toString
public java.lang.String toString()
- Overrides:
toString
in classIClass.IField
-
getConstantValue
public java.lang.Object getConstantValue() throws CompileException
This implementation ofIClass.IField.getConstantValue()
is not completely correct:- It treats non-static fields as non-constant
-
Even fields with a non-constant initializer are identified as constant. (The value of that
field may be different in a different JVM instance -- the classical example is
File.separator
.)
Notice that enum constants are not constant expression (despite the similarity of names).
- Specified by:
getConstantValue
in classIClass.IField
- Throws:
CompileException
-
-