Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.techtrader.modules.tools.bytecode
Class BCEntity  view BCEntity download BCEntity.java

java.lang.Object
  extended bycom.techtrader.modules.tools.bytecode.BCEntity
All Implemented Interfaces:
com.techtrader.modules.tools.bytecode.visitor.VisitAcceptor
Direct Known Subclasses:
Attribute, BCClass, BCField, BCMethod

public abstract class BCEntity
extends java.lang.Object
implements com.techtrader.modules.tools.bytecode.visitor.VisitAcceptor

Abstract superclass for all complex bytecode entities. All bytecode entities contain attributes and are able to access the constant pool.


Field Summary
private  java.util.List _attributes
           
 
Constructor Summary
BCEntity()
           
 
Method Summary
 Attribute addAttribute(java.lang.String name)
          Add an attribute of the given type.
 void clearAttributes()
          Clear all attributes from this entity.
 Attribute getAttribute(java.lang.String name)
          Return the attribute with the given name.
 Attribute[] getAttributes()
          Get all the attributes owned by this entity.
 Attribute[] getAttributes(java.lang.String name)
          Returns all attributes with the given name.
abstract  com.techtrader.modules.tools.bytecode.lowlevel.ConstantPool getPool()
          Return the constant pool for the current class.
 Attribute importAttribute(Attribute attr)
          Import an attribute from another entity, or make a copy of one on this entity.
 void importAttributes(BCEntity other)
          Import all attributes from another entity.
protected  void readAttributes(java.io.DataInput in)
          Clears the attribute list and rebuilds it from the given stream.
 boolean removeAttribute(Attribute attribute)
          Remove the given attribute.
 boolean removeAttribute(java.lang.String name)
          Remove all attributes with the given name from the list.
 void visitAttributes(com.techtrader.modules.tools.bytecode.visitor.BCVisitor visit)
          Convenience method to be called by BCEntities when being visited by a BCVisitor; this method will allow the visitor to visit all attributes of this entity.
protected  void writeAttributes(java.io.DataOutput out)
          Writes all the owned attributes to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.techtrader.modules.tools.bytecode.visitor.VisitAcceptor
acceptVisit
 

Field Detail

_attributes

private java.util.List _attributes
Constructor Detail

BCEntity

public BCEntity()
Method Detail

getPool

public abstract com.techtrader.modules.tools.bytecode.lowlevel.ConstantPool getPool()
Return the constant pool for the current class.


getAttributes

public Attribute[] getAttributes()
Get all the attributes owned by this entity.


getAttribute

public Attribute getAttribute(java.lang.String name)
Return the attribute with the given name. If multiple attributes share the name, which is returned is undefined.


getAttributes

public Attribute[] getAttributes(java.lang.String name)
Returns all attributes with the given name.


importAttribute

public Attribute importAttribute(Attribute attr)
Import an attribute from another entity, or make a copy of one on this entity.


importAttributes

public void importAttributes(BCEntity other)
Import all attributes from another entity.


addAttribute

public Attribute addAttribute(java.lang.String name)
Add an attribute of the given type.


clearAttributes

public void clearAttributes()
Clear all attributes from this entity.


removeAttribute

public boolean removeAttribute(java.lang.String name)
Remove all attributes with the given name from the list.


removeAttribute

public boolean removeAttribute(Attribute attribute)
Remove the given attribute. After being removed, the given Attribute is invalid, and the result of any operations on it are undefined.


readAttributes

protected void readAttributes(java.io.DataInput in)
                       throws java.io.IOException
Clears the attribute list and rebuilds it from the given stream. Relies on the ability of attributes to read themselves, and requires access to the constant pool, which must already by read.


writeAttributes

protected void writeAttributes(java.io.DataOutput out)
                        throws java.io.IOException
Writes all the owned attributes to the given stream. Relies on the ability of attributes to write themselves.


visitAttributes

public void visitAttributes(com.techtrader.modules.tools.bytecode.visitor.BCVisitor visit)
Convenience method to be called by BCEntities when being visited by a BCVisitor; this method will allow the visitor to visit all attributes of this entity.