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.Fieldfield
-
Constructor Summary
Constructors Constructor Description ReflectionIField(java.lang.reflect.Field field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessgetAccess()IClass.IAnnotation[]getAnnotations()java.lang.ObjectgetConstantValue()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.StringgetName()IClassgetType()booleanisStatic()java.lang.StringtoString()-
Methods inherited from class org.codehaus.janino.IClass.IField
getDeclaringIClass, getDescriptor
-
-
-
-
Method Detail
-
getAccess
public Access getAccess()
- Specified by:
getAccessin interfaceIClass.IMember- Specified by:
getAccessin classIClass.IField- Returns:
- One of
Access.PRIVATE,Access.PROTECTED,Access.DEFAULTandAccess.PUBLIC.
-
getAnnotations
public IClass.IAnnotation[] getAnnotations()
- Returns:
- Modifiers and/or annotations of this member
-
getName
public java.lang.String getName()
- Specified by:
getNamein classIClass.IField- Returns:
- The name this field
-
isStatic
public boolean isStatic()
- Specified by:
isStaticin classIClass.IField- Returns:
- Whether this field is STATIC
-
getType
public IClass getType()
- Specified by:
getTypein classIClass.IField- Returns:
- The type of this field
-
toString
public java.lang.String toString()
- Overrides:
toStringin classIClass.IField
-
getConstantValue
public java.lang.Object getConstantValue() throws CompileExceptionThis 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:
getConstantValuein classIClass.IField- Throws:
CompileException
-
-