attrib4j.cfparse
Class CFParseClassAnnotator

java.lang.Object
  |
  +--attrib4j.cfparse.CFParseClassAnnotator
All Implemented Interfaces:
ClassAnnotator

public class CFParseClassAnnotator
extends java.lang.Object
implements ClassAnnotator

The CFParse implementation of a ClassAnnotator. This class will use the CFParse API to insert attributes into .class files.

Version:
$Revision: 1.5 $ $Date: 2003/09/01 19:56:16 $
Author:
Mark Pollack, Ted Neward

Constructor Summary
CFParseClassAnnotator(java.io.InputStream classFile)
          Create the instance using an InputStream initialized to the class file that will be modified/annotated.
 
Method Summary
 java.lang.Object createAttributeInstance(java.lang.String text, java.net.URLClassLoader classLoader, java.lang.String[] attributePackages)
          Just added to avoid compilation error.
 void insertClassAttribute(java.lang.Object attribute)
          Insert a custom class attribute into the bytecode.
 void insertFieldAttribute(java.lang.String field, java.lang.Object attribute)
          Insert a custom field attribute into the bytecode.
 void insertMethodAttribute(com.sun.javadoc.MethodDoc methodDoc, java.lang.Object attribute)
          Insert a custom method attribute into the bytecode.
 void write(java.lang.String destDir)
          Write out the modified classfile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CFParseClassAnnotator

public CFParseClassAnnotator(java.io.InputStream classFile)
                      throws AttributeException
Create the instance using an InputStream initialized to the class file that will be modified/annotated.

Throws:
AttributeException - if an error occurs
Method Detail

insertClassAttribute

public void insertClassAttribute(java.lang.Object attribute)
Insert a custom class attribute into the bytecode.

Specified by:
insertClassAttribute in interface ClassAnnotator
Parameters:
attribute - The attribute to be inserted.

insertFieldAttribute

public void insertFieldAttribute(java.lang.String field,
                                 java.lang.Object attribute)
Insert a custom field attribute into the bytecode.

Specified by:
insertFieldAttribute in interface ClassAnnotator
Parameters:
field - The name of the field to apply the attribute.
attribute - The attribute to be inserted.

insertMethodAttribute

public void insertMethodAttribute(com.sun.javadoc.MethodDoc methodDoc,
                                  java.lang.Object attribute)
Insert a custom method attribute into the bytecode.

Specified by:
insertMethodAttribute in interface ClassAnnotator
Parameters:
methodDoc - The Javadoc metadata class defining the method to annotate.
attribute - The attribute to be inserted.

write

public void write(java.lang.String destDir)
Write out the modified classfile.

Specified by:
write in interface ClassAnnotator
Parameters:
destDir - The directory where the modified class fiel should be written.

createAttributeInstance

public java.lang.Object createAttributeInstance(java.lang.String text,
                                                java.net.URLClassLoader classLoader,
                                                java.lang.String[] attributePackages)
Just added to avoid compilation error. Will remove CFParse support soon.

Specified by:
createAttributeInstance in interface ClassAnnotator
Parameters:
text - The string describing the attribute.
classLoader - The class loader user to resolve the attribute class
attributePackages - The list of package names to prefix the attribute search
Returns:
Object The attribute object for storage in the bytecode or elsewhere.
See Also:
ClassAnnotator.createAttributeInstance(java.lang.String, java.net.URLClassLoader, java.lang.String[])


Copyright © 2002-2003 Mark Pollack. All Rights Reserved.