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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis 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.getName()
getType()
boolean
isStatic()
toString()
Methods inherited from class org.codehaus.janino.IClass.IField
getDeclaringIClass, getDescriptor
-
Field Details
-
field
-
-
Constructor Details
-
ReflectionIField
ReflectionIField(Field field)
-
-
Method Details
-
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
- Returns:
- Modifiers and/or annotations of this member
-
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
- Specified by:
getType
in classIClass.IField
- Returns:
- The type of this field
-
toString
- Overrides:
toString
in classIClass.IField
-
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. (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
-