public class Compiler extends java.lang.ObjectA bytecode translator for reflection.
This translator directly modifies class files on a local disk so that the classes represented by those class files are reflective. After the modification, the class files can be run with the standard JVM without
javassist.tools.reflect.Loaderor any other user-defined class loader.
The modified class files are given as the command-line parameters, which are a sequence of fully-qualified class names followed by options:
-m classname: specifies the class of the metaobjects associated with instances of the class followed by this option. The default is
-c classname: specifies the class of the class metaobjects associated with instances of the class followed by this option. The default is
If a class name is not followed by any options, the class indicated by that class name is not reflective.
% java Compiler Dog -m MetaDog -c CMetaDog Cat -m MetaCat Cow
modifies class files
Cow.class. The metaobject of a Dog object is a MetaDog object and the class metaobject is a CMetaDog object. The metaobject of a Cat object is a MetaCat object but the class metaobject is a default one. Cow objects are not reflective.
Note that if the super class is also made reflective, it must be done before the sub class.
Constructors Constructor Description