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()booleanisStatic()toString()Methods inherited from class IClass.IField
getDeclaringIClass, getDescriptor
-
Field Details
-
field
-
-
Constructor Details
-
ReflectionIField
ReflectionIField(Field field)
-
-
Method Details
-
getAccess
- Specified by:
getAccessin interfaceIClass.IMember- Specified by:
getAccessin classIClass.IField- Returns:
- One of
Access.PRIVATE,Access.PROTECTED,Access.DEFAULTandAccess.PUBLIC.
-
getAnnotations
- Returns:
- Modifiers and/or annotations of this member
-
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
- Specified by:
getTypein classIClass.IField- Returns:
- The type of this field
-
toString
- Overrides:
toStringin 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:
getConstantValuein classIClass.IField- Throws:
CompileException
-