polyglot.types.reflect
Class Field
java.lang.Object
polyglot.types.reflect.Field
public class Field
- extends java.lang.Object
Field models a field (member variable) in a class. The Field class
grants access to information such as the field's modifiers, its name
and type descriptor (represented as indices into the constant pool),
and any attributes of the field. Static fields have a ConstantValue
attribute.
- Author:
- Nate Nystrom
(nystrom@cs.purdue.edu)
- See Also:
ConstantValue
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
in
protected java.io.DataInputStream in
clazz
protected ClassFile clazz
modifiers
protected int modifiers
name
protected int name
type
protected int type
attrs
protected Attribute[] attrs
constantValue
protected ConstantValue constantValue
synthetic
protected boolean synthetic
initialize
public void initialize()
throws java.io.IOException
- Throws:
java.io.IOException
isString
public boolean isString(Type t)
- Return true of t is java.lang.String.
We don't compare against ts.String() because ts.String() may not
yet be set.
isSynthetic
public boolean isSynthetic()
isConstant
public boolean isConstant()
constantValue
public Constant constantValue()
getInt
public int getInt()
throws SemanticException
- Throws:
SemanticException
getFloat
public float getFloat()
throws SemanticException
- Throws:
SemanticException
getDouble
public double getDouble()
throws SemanticException
- Throws:
SemanticException
getLong
public long getLong()
throws SemanticException
- Throws:
SemanticException
getString
public java.lang.String getString()
throws SemanticException
- Throws:
SemanticException
getAttrs
public Attribute[] getAttrs()
getClazz
public ClassFile getClazz()
getConstantValue
public ConstantValue getConstantValue()
getModifiers
public int getModifiers()
getName
public int getName()
getType
public int getType()
name
public java.lang.String name()