polyglot.types.reflect
Class Field

java.lang.Object
  extended by 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

Field Summary
protected  Attribute[] attrs
           
protected  ClassFile clazz
           
protected  ConstantValue constantValue
           
protected  java.io.DataInputStream in
           
protected  int modifiers
           
protected  int name
           
protected  boolean synthetic
           
protected  int type
           
 
Method Summary
 Constant constantValue()
           
 Attribute[] getAttrs()
           
 ClassFile getClazz()
           
 ConstantValue getConstantValue()
           
 double getDouble()
           
 float getFloat()
           
 int getInt()
           
 long getLong()
           
 int getModifiers()
           
 int getName()
           
 java.lang.String getString()
           
 int getType()
           
 void initialize()
           
 boolean isConstant()
           
 boolean isString(Type t)
          Return true of t is java.lang.String.
 boolean isSynthetic()
           
 java.lang.String name()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Method Detail

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()