|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcaas.util.AnnotationUtil
public class AnnotationUtil
This class provides a set of utility methods for annotating a class file.
Constructor Summary | |
---|---|
AnnotationUtil()
|
Method Summary | |
---|---|
static org.apache.bcel.classfile.JavaClass |
produceAnnotatedJavaClass(AnnotationScript script,
org.apache.bcel.classfile.JavaClass jclass)
Given an AnnotationScript object and a JavaClass object, creates a new JavaClass object representing the AnnotationsScript object's annotation of that class. |
static org.apache.bcel.classfile.JavaClass |
produceAnnotatedJavaClass(java.io.File scriptFile,
org.apache.bcel.classfile.JavaClass jclass)
Given a File object pointing to an annotation script and a JavaClass object representing a java class to annotate, gives a JavaClass such that the annotations of the script are applied to it. |
static void |
writeAnnotationOfClassFile(AnnotationScript script,
java.io.File in,
java.io.File out)
Given an AnnotationScript instance, and two File, in and out, reads the class file from in, runs the AnnotationScript on all InstructionLists in the class and then writes the annotated version to the out file. |
static void |
writeAnnotationOfClassFile(java.io.File scriptFile,
java.io.File in,
java.io.File out)
Given three File objects representing a annotation script file, class file to read, and a class file to write to, builds an AnnotationScript instance, runs it on the given class, and writes its annotated version. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationUtil()
Method Detail |
---|
public static org.apache.bcel.classfile.JavaClass produceAnnotatedJavaClass(AnnotationScript script, org.apache.bcel.classfile.JavaClass jclass) throws java.lang.Exception
script
- the annotation script.jclass
- the class to annotated.
java.lang.Exception
public static org.apache.bcel.classfile.JavaClass produceAnnotatedJavaClass(java.io.File scriptFile, org.apache.bcel.classfile.JavaClass jclass) throws java.lang.Exception
scriptFile
- the annotation script.jclass
- the class to annotate.
java.lang.Exception
public static void writeAnnotationOfClassFile(AnnotationScript script, java.io.File in, java.io.File out) throws java.lang.Exception
script
- an AnnotationScript to run on the class.in
- the file to read the class from.out
- the file to write the class to.
java.lang.Exception
- thrown when their is parsing or I/O error.public static void writeAnnotationOfClassFile(java.io.File scriptFile, java.io.File in, java.io.File out) throws java.lang.Exception
scriptFile
- a File object pointing to a valid annotation script.in
- a File object pointing to a valid class file.out
- a File object pointing to a file to which the annotated class will be written.
java.lang.Exception
- thrown in the case of an I/O exception or parsing exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |