alt.jiapi.file
Class ProgramElement

java.lang.Object
  extended by alt.jiapi.file.ProgramElement
Direct Known Subclasses:
ClassFile, Field, Method

public class ProgramElement
extends java.lang.Object

This class holds mainly attribute reading and writing of program elements of class file. Program elements are class, methods and fields.

Author:
Mika Riekkinen

Field Summary
protected  short access_flags
           
protected  java.util.List attributes
           
protected  ConstantPool constantPool
           
 
Constructor Summary
protected ProgramElement(ConstantPool constantPool)
           
protected ProgramElement(ConstantPool constantPool, short access_flags)
           
protected ProgramElement(ConstantPool constantPool, short access_flags, java.util.List attributes)
           
 
Method Summary
 short getAccessFlags()
           
 Attribute getAttribute(java.lang.String name)
          Gets a named attribute from this ProgramElement.
 java.util.List getAttributes()
          Gets all the class level attributes of this ClassFile.
 ConstantPool getConstantPool()
           
protected  java.util.List readAttributes(java.io.DataInputStream dis)
          Reads attributes of the program element.
protected  void writeAttributes(java.io.DataOutputStream dos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

access_flags

protected short access_flags

attributes

protected java.util.List attributes

constantPool

protected ConstantPool constantPool
Constructor Detail

ProgramElement

protected ProgramElement(ConstantPool constantPool)

ProgramElement

protected ProgramElement(ConstantPool constantPool,
                         short access_flags)

ProgramElement

protected ProgramElement(ConstantPool constantPool,
                         short access_flags,
                         java.util.List attributes)
Method Detail

getAccessFlags

public short getAccessFlags()

getAttribute

public Attribute getAttribute(java.lang.String name)
Gets a named attribute from this ProgramElement.

Parameters:
name - Name of the attribute
Returns:
Attribute found, or null if there was no attribute of given name

getAttributes

public java.util.List getAttributes()
Gets all the class level attributes of this ClassFile.

Returns:
a List of Attributes

getConstantPool

public ConstantPool getConstantPool()

readAttributes

protected java.util.List readAttributes(java.io.DataInputStream dis)
                                 throws java.io.IOException
Reads attributes of the program element. First 'short' read is expected to contain attribute count.

Throws:
java.io.IOException

writeAttributes

protected void writeAttributes(java.io.DataOutputStream dos)
                        throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2001. Documenation generated August 26 2011.