Uses of Class
javassist.CtClass

Packages that use CtClass
javassist The Javassist Core API. 
javassist.bytecode Bytecode-level API. 
javassist.expr This package contains the classes for modifying a method body. 
javassist.preproc A sample preprocessor. 
javassist.reflect Runtime Reflection. 
 

Uses of CtClass in javassist
 

Subclasses of CtClass in javassist
 class CtPrimitiveType
          An instance of CtPrimitiveType represents a primitive type.
 

Fields in javassist declared as CtClass
static CtClass CtClass.booleanType
          The CtClass object representing the boolean type.
static CtClass CtClass.charType
          The CtClass object representing the char type.
static CtClass CtClass.byteType
          The CtClass object representing the byte type.
static CtClass CtClass.shortType
          The CtClass object representing the short type.
static CtClass CtClass.intType
          The CtClass object representing the int type.
static CtClass CtClass.longType
          The CtClass object representing the long type.
static CtClass CtClass.floatType
          The CtClass object representing the float type.
static CtClass CtClass.doubleType
          The CtClass object representing the double type.
static CtClass CtClass.voidType
          The CtClass object representing the void type.
 

Methods in javassist that return CtClass
 CtClass CtMethod.getDeclaringClass()
          Returns the class that declares this method.
 CtClass[] CtMethod.getParameterTypes()
          Obtains parameter types of this method.
 CtClass CtMethod.getReturnType()
          Obtains the type of the returned value.
 CtClass[] CtMethod.getExceptionTypes()
          Obtains exceptions that this method may throw.
 CtClass CtMember.getDeclaringClass()
          Returns the class that declares this member.
 CtClass CtField.getDeclaringClass()
          Returns the class declaring the field.
 CtClass CtField.getType()
          Returns the type of the field.
 CtClass CtConstructor.getDeclaringClass()
          Returns the class that declares this constructor.
 CtClass[] CtConstructor.getParameterTypes()
          Obtains parameter types of this constructor.
 CtClass[] CtConstructor.getExceptionTypes()
          Obtains exceptions that this constructor may throw.
 CtClass CtClass.getComponentType()
          If this object represents an array, this method returns the component type of the array.
 CtClass CtClass.getSuperclass()
          Obtains the class object representing the superclass of the class.
 CtClass[] CtClass.getInterfaces()
          Obtains the class objects representing the interfaces of the class.
 CtClass[] CtBehavior.getParameterTypes()
          Obtains parameter types of this member.
 CtClass[] CtBehavior.getExceptionTypes()
          Obtains exceptions that this member may throw.
 CtClass ClassPool.getAndRename(java.lang.String orgName, java.lang.String newName)
          Reads a class file and constructs a CtClass object with a new name.
 CtClass ClassPool.get(java.lang.String classname)
          Reads a class file from the source and returns a reference to the CtClass object representing that class file.
 CtClass[] ClassPool.get(java.lang.String[] classnames)
          Reads class files from the source and returns an array of CtClass objects representing those class files.
 CtClass ClassPool.makeClass(java.io.InputStream classfile)
          Creates a new class from the given class file.
 CtClass ClassPool.makeClass(java.lang.String classname)
          Creates a new public class.
 CtClass ClassPool.makeClass(java.lang.String classname, CtClass superclass)
          Creates a new public class.
 CtClass ClassPool.makeInterface(java.lang.String name)
          Creates a new public interface.
 CtClass ClassPool.makeInterface(java.lang.String name, CtClass superclass)
          Creates a new public interface.
 

Methods in javassist with parameters of type CtClass
static void SerialVersionUID.setSerialVersionUID(CtClass clazz)
          Adds serialVersionUID if one does not already exist.
static CtMethod CtNewMethod.make(java.lang.String src, CtClass declaring)
          Compiles the given source code and creates a method.
static CtMethod CtNewMethod.make(java.lang.String src, CtClass declaring, java.lang.String delegateObj, java.lang.String delegateMethod)
          Compiles the given source code and creates a method.
static CtMethod CtNewMethod.make(CtClass returnType, java.lang.String mname, CtClass[] parameters, CtClass[] exceptions, java.lang.String body, CtClass declaring)
          Creates a public method.
static CtMethod CtNewMethod.copy(CtMethod src, CtClass declaring, ClassMap map)
          Creates a copy of a method.
static CtMethod CtNewMethod.copy(CtMethod src, java.lang.String name, CtClass declaring, ClassMap map)
          Creates a copy of a method with a new name.
static CtMethod CtNewMethod.abstractMethod(CtClass returnType, java.lang.String mname, CtClass[] parameters, CtClass[] exceptions, CtClass declaring)
          Creates a public abstract method.
static CtMethod CtNewMethod.delegator(CtMethod delegate, CtClass declaring)
          Creates a method forwarding to a delegate in a super class.
static CtMethod CtNewMethod.wrapped(CtClass returnType, java.lang.String mname, CtClass[] parameterTypes, CtClass[] exceptionTypes, CtMethod body, CtMethod.ConstParameter constParam, CtClass declaring)
          Creates a wrapped method.
static CtConstructor CtNewConstructor.make(java.lang.String src, CtClass declaring)
          Compiles the given source code and creates a constructor.
static CtConstructor CtNewConstructor.make(CtClass[] parameters, CtClass[] exceptions, java.lang.String body, CtClass declaring)
          Creates a public constructor.
static CtConstructor CtNewConstructor.copy(CtConstructor c, CtClass declaring, ClassMap map)
          Creats a copy of a constructor.
static CtConstructor CtNewConstructor.defaultConstructor(CtClass declaring)
          Creates a default (public) constructor.
static CtConstructor CtNewConstructor.skeleton(CtClass[] parameters, CtClass[] exceptions, CtClass declaring)
          Creates a public constructor that only calls a constructor in the super class.
static CtConstructor CtNewConstructor.make(CtClass[] parameters, CtClass[] exceptions, CtClass declaring)
          Creates a public constructor that only calls a constructor in the super class.
static CtConstructor CtNewConstructor.make(CtClass[] parameters, CtClass[] exceptions, int howto, CtMethod body, CtMethod.ConstParameter cparam, CtClass declaring)
          Creates a public constructor.
 void CtMethod.setExceptionTypes(CtClass[] types)
          Sets exceptions that this method may throw.
 void CtMethod.addCatch(java.lang.String src, CtClass exceptionType)
          Adds a catch clause that handles an exception thrown in the method body.
static CtField CtField.make(java.lang.String src, CtClass declaring)
          Compiles the given source code and creates a field.
 void CtField.setType(CtClass clazz)
          Sets the type of the field.
static CtField.Initializer CtField.Initializer.byNew(CtClass objectType)
          Makes an initializer creating a new object.
static CtField.Initializer CtField.Initializer.byNew(CtClass objectType, java.lang.String[] stringParams)
          Makes an initializer creating a new object.
static CtField.Initializer CtField.Initializer.byNewWithParams(CtClass objectType)
          Makes an initializer creating a new object.
static CtField.Initializer CtField.Initializer.byNewWithParams(CtClass objectType, java.lang.String[] stringParams)
          Makes an initializer creating a new object.
static CtField.Initializer CtField.Initializer.byCall(CtClass methodClass, java.lang.String methodName)
          Makes an initializer calling a static method.
static CtField.Initializer CtField.Initializer.byCall(CtClass methodClass, java.lang.String methodName, java.lang.String[] stringParams)
          Makes an initializer calling a static method.
static CtField.Initializer CtField.Initializer.byCallWithParams(CtClass methodClass, java.lang.String methodName)
          Makes an initializer calling a static method.
static CtField.Initializer CtField.Initializer.byCallWithParams(CtClass methodClass, java.lang.String methodName, java.lang.String[] stringParams)
          Makes an initializer calling a static method.
static CtField.Initializer CtField.Initializer.byNewArray(CtClass type, int size)
          Makes an initializer creating a new array.
static CtField.Initializer CtField.Initializer.byNewArray(CtClass type, int[] sizes)
          Makes an initializer creating a new multi-dimensional array.
 void CtConstructor.setExceptionTypes(CtClass[] types)
          Sets exceptions that this constructor may throw.
 void CtConstructor.addCatch(java.lang.String src, CtClass exceptionType)
          Adds a catch clause that handles an exception thrown in the constructor body.
 boolean CtClass.subtypeOf(CtClass clazz)
          Returns true if this class extends or implements clazz.
 boolean CtClass.subclassOf(CtClass superclass)
          Determines whether the class directly or indirectly extends the given class.
 void CtClass.setSuperclass(CtClass clazz)
          Changes a super class.
 void CtClass.setInterfaces(CtClass[] list)
          Sets interfaces.
 void CtClass.addInterface(CtClass anInterface)
          Adds an interface.
 CtConstructor CtClass.getDeclaredConstructor(CtClass[] params)
          Returns a constructor receiving the specified parameters.
 CtMethod CtClass.getDeclaredMethod(java.lang.String name, CtClass[] params)
          Retrieves the method with the specified name and parameter types among the methods declared in the class.
 void CtBehavior.setExceptionTypes(CtClass[] types)
          Sets exceptions that this member may throw.
 void CtBehavior.addCatch(java.lang.String src, CtClass exceptionType)
          Adds a catch clause that handles an exception thrown in the body.
 void CtBehavior.addCatch(java.lang.String src, CtClass exceptionType, java.lang.String exceptionName)
          Adds a catch clause that handles an exception thrown in the body.
 void CodeConverter.replaceNew(CtClass newClass, CtClass calledClass, java.lang.String calledMethod)
          Modify a method body so that instantiation of the specified class is replaced with a call to the specified static method.
 void CodeConverter.redirectFieldAccess(CtField field, CtClass newClass, java.lang.String newFieldname)
          Modify a method body so that field read/write expressions access a different field from the original one.
 void CodeConverter.replaceFieldRead(CtField field, CtClass calledClass, java.lang.String calledMethod)
          Modify a method body so that an expression reading the specified field is replaced with a call to the specified static method.
 void CodeConverter.replaceFieldWrite(CtField field, CtClass calledClass, java.lang.String calledMethod)
          Modify a method body so that an expression writing the specified field is replaced with a call to the specified static method.
 CtClass ClassPool.makeClass(java.lang.String classname, CtClass superclass)
          Creates a new public class.
 CtClass ClassPool.makeInterface(java.lang.String name, CtClass superclass)
          Creates a new public interface.
 void ClassMap.put(CtClass oldname, CtClass newname)
          Maps a class name to another name in this hashtable.
 void ClassMap.fix(CtClass clazz)
          Prevents a mapping from the specified class name to another name.
 

Constructors in javassist with parameters of type CtClass
CtMethod(CtClass returnType, java.lang.String mname, CtClass[] parameters, CtClass declaring)
          Creates a public abstract method.
CtMethod(CtMethod src, CtClass declaring, ClassMap map)
          Creates a copy of a CtMethod object.
CtField(CtClass type, java.lang.String name, CtClass declaring)
          Creates a CtField object.
CtField(CtField src, CtClass declaring)
          Creates a copy of the given field.
CtConstructor(CtClass[] parameters, CtClass declaring)
          Creates a constructor with no constructor body.
CtConstructor(CtConstructor src, CtClass declaring, ClassMap map)
          Creates a copy of a CtConstructor object.
 

Uses of CtClass in javassist.bytecode
 

Fields in javassist.bytecode declared as CtClass
static CtClass ConstPool.THIS
          Represents the class using this constant pool table.
static CtClass Bytecode.THIS
          Represents the CtClass file using the constant pool table given to this Bytecode object.
 

Methods in javassist.bytecode that return CtClass
static CtClass[] Descriptor.getParameterTypes(java.lang.String desc, ClassPool cp)
          Returns the CtClass objects representing the parameter types specified by the given descriptor.
static CtClass Descriptor.getReturnType(java.lang.String desc, ClassPool cp)
          Returns the CtClass object representing the return type specified by the given descriptor.
static CtClass Descriptor.toCtClass(java.lang.String desc, ClassPool cp)
          Returns a CtClass object representing the type specified by the given descriptor.
 

Methods in javassist.bytecode with parameters of type CtClass
static java.lang.String Descriptor.toJvmName(CtClass clazz)
          Returns the internal representation of the class name in the JVM.
static java.lang.String Descriptor.of(CtClass type)
          Returns the descriptor representing the given type.
static java.lang.String Descriptor.ofConstructor(CtClass[] paramTypes)
          Returns the descriptor representing a constructor receiving the given parameter types.
static java.lang.String Descriptor.ofMethod(CtClass returnType, CtClass[] paramTypes)
          Returns the descriptor representing a method that receives the given parameter types and returns the given type.
static java.lang.String Descriptor.ofParameters(CtClass[] paramTypes)
          Returns the descriptor representing a list of parameter types.
 int ConstPool.addClassInfo(CtClass c)
          Adds a new CONSTANT_Class_info structure.
 void Bytecode.setMaxLocals(boolean isStatic, CtClass[] params, int locals)
          Sets max_locals.
 void Bytecode.addExceptionHandler(int start, int end, int handler, CtClass type)
          Adds a new entry of exception_table.
 int Bytecode.addLoad(int n, CtClass type)
          Appends an instruction for loading a value from the local variable at the index n.
 int Bytecode.addStore(int n, CtClass type)
          Appends an instruction for storing a value into the local variable at the index n.
 int Bytecode.addLoadParameters(CtClass[] params, int offset)
          Appends instructions for loading all the parameters onto the operand stack.
 void Bytecode.addCheckcast(CtClass c)
          Appends CHECKCAST.
 void Bytecode.addGetfield(CtClass c, java.lang.String name, java.lang.String type)
          Appends GETFIELD.
 void Bytecode.addGetstatic(CtClass c, java.lang.String name, java.lang.String type)
          Appends GETSTATIC.
 void Bytecode.addInvokespecial(CtClass clazz, java.lang.String name, CtClass returnType, CtClass[] paramTypes)
          Appends INVOKESPECIAL.
 void Bytecode.addInvokespecial(CtClass clazz, java.lang.String name, java.lang.String desc)
          Appends INVOKESPECIAL.
 void Bytecode.addInvokestatic(CtClass clazz, java.lang.String name, CtClass returnType, CtClass[] paramTypes)
          Appends INVOKESTATIC.
 void Bytecode.addInvokestatic(CtClass clazz, java.lang.String name, java.lang.String desc)
          Appends INVOKESTATIC.
 void Bytecode.addInvokevirtual(CtClass clazz, java.lang.String name, CtClass returnType, CtClass[] paramTypes)
          Appends INVOKEVIRTUAL.
 void Bytecode.addInvokevirtual(CtClass clazz, java.lang.String name, java.lang.String desc)
          Appends INVOKEVIRTUAL.
 void Bytecode.addInvokeinterface(CtClass clazz, java.lang.String name, CtClass returnType, CtClass[] paramTypes, int count)
          Appends INVOKEINTERFACE.
 void Bytecode.addInvokeinterface(CtClass clazz, java.lang.String name, java.lang.String desc, int count)
          Appends INVOKEINTERFACE.
 void Bytecode.addNew(CtClass clazz)
          Appends NEW.
 void Bytecode.addAnewarray(CtClass clazz, int length)
          Appends ICONST and ANEWARRAY.
 int Bytecode.addMultiNewarray(CtClass clazz, int[] dimensions)
          Appends MULTINEWARRAY.
 int Bytecode.addMultiNewarray(CtClass clazz, int dim)
          Appends MULTINEWARRAY.
 void Bytecode.addPutfield(CtClass c, java.lang.String name, java.lang.String desc)
          Appends PUTFIELD.
 void Bytecode.addPutstatic(CtClass c, java.lang.String name, java.lang.String desc)
          Appends PUTSTATIC.
 void Bytecode.addReturn(CtClass type)
          Appends ARETURN, IRETURN, .., or RETURN.
 

Uses of CtClass in javassist.expr
 

Methods in javassist.expr that return CtClass
 CtClass[] NewExpr.mayThrow()
          Returns the list of exceptions that the expression may throw.
 CtClass[] MethodCall.mayThrow()
          Returns the list of exceptions that the expression may throw.
 CtClass Instanceof.getType()
          Returns the CtClass object representing the type name on the right hand side of the instanceof operator.
 CtClass[] Instanceof.mayThrow()
          Returns the list of exceptions that the expression may throw.
 CtClass[] Handler.mayThrow()
          Returns the list of exceptions that the catch clause may throw.
 CtClass Handler.getType()
          Returns the type handled by the catch clause.
 CtClass[] FieldAccess.mayThrow()
          Returns the list of exceptions that the expression may throw.
 CtClass[] Expr.mayThrow()
          Returns the list of exceptions that the expression may throw.
 CtClass Cast.getType()
          Returns the CtClass object representing the type specified by the cast.
 CtClass[] Cast.mayThrow()
          Returns the list of exceptions that the expression may throw.
 

Methods in javassist.expr with parameters of type CtClass
 boolean ExprEditor.doit(CtClass clazz, MethodInfo minfo)
          Undocumented method.
 

Uses of CtClass in javassist.preproc
 

Methods in javassist.preproc that return CtClass
 CtClass[] Assistant.assist(ClassPool cp, java.lang.String importname, java.lang.String[] args)
          Is called when the Javassist preprocessor encounters an import declaration annotated with the "by" keyword.
 

Uses of CtClass in javassist.reflect
 

Methods in javassist.reflect with parameters of type CtClass
 boolean Reflection.makeReflective(CtClass clazz, CtClass metaobject, CtClass metaclass)
          Produces a reflective class.
 



Javassist, a Java-bytecode translator toolkit. Copyright (C) 1999-2003 Shigeru Chiba. All Rights Reserved.