Package javassist
Class CtNewClass
- java.lang.Object
-
- javassist.CtClass
-
- javassist.CtClassType
-
- javassist.CtNewClass
-
- Direct Known Subclasses:
CtNewNestedClass
class CtNewClass extends CtClassType
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javassist.CtClass
CtClass.DelayedFileOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanhasConstructor-
Fields inherited from class javassist.CtClassType
classfile, classPool, gcConstPool, rawClassfile, wasChanged, wasPruned
-
Fields inherited from class javassist.CtClass
booleanType, byteType, charType, debugDump, doubleType, floatType, intType, javaLangObject, longType, primitiveTypes, qualifiedName, shortType, version, voidType
-
-
Constructor Summary
Constructors Constructor Description CtNewClass(java.lang.String name, ClassPool cp, boolean isInterface, CtClass superclass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConstructor(CtConstructor c)Adds a constructor.protected voidextendToString(java.lang.StringBuffer buffer)Implemented in subclasses to add to theCtClass.toString()result.voidinheritAllConstructors()Adds constructors inhrited from the super class.private booleanisInheritable(int mod, CtClass superclazz)voidtoBytecode(java.io.DataOutputStream out)Converts this class to a class file.-
Methods inherited from class javassist.CtClassType
addField, addField, addInterface, addMethod, checkModify, compress, defrost, freeze, getAccessorMaker, getAnnotation, getAnnotations, getAnnotationType, getAttribute, getAvailableAnnotations, getClassFile2, getClassFile3, getClassInitializer, getClassPool, getConstructor, getConstructors, getDeclaredBehaviors, getDeclaredConstructors, getDeclaredField, getDeclaredField, getDeclaredFields, getDeclaredMethod, getDeclaredMethod, getDeclaredMethods, getDeclaredMethods, getDeclaringClass, getEnclosingBehavior, getField, getField2, getFields, getGenericSignature, getHiddenMethods, getInterfaces, getMembers, getMethod, getMethods, getModifiers, getNestedClasses, getSuperclass, getUniqueNumber, getURL, hasAnnotation, hasAnnotationType, hasAnnotationType, hasMemberCache, incGetCounter, instrument, instrument, isAnnotation, isEnum, isFrozen, isInterface, isModified, makeClassInitializer, makeNestedClass, makeUniqueName, prune, rebuildClassFile, removeConstructor, removeField, removeMethod, replaceClassName, replaceClassName, setAttribute, setClassPool, setGenericSignature, setInterfaces, setModifiers, setName, setSuperclass, stopPruning, subclassOf, subtypeOf, toAnnotationType, toAnnotationType
-
Methods inherited from class javassist.CtClass
addField, debugWriteFile, debugWriteFile, detach, getClassFile, getComponentType, getDeclaredClasses, getDeclaredConstructor, getEnclosingMethod, getField, getName, getPackageName, getRefClasses, getSimpleName, hasAnnotation, isArray, isPrimitive, main, makeFileOutput, toBytecode, toClass, toClass, toClass, toString, writeFile, writeFile
-
-
-
-
Method Detail
-
extendToString
protected void extendToString(java.lang.StringBuffer buffer)
Description copied from class:CtClassImplemented in subclasses to add to theCtClass.toString()result. Subclasses should put a space before each token added to the buffer.- Overrides:
extendToStringin classCtClassType
-
addConstructor
public void addConstructor(CtConstructor c) throws CannotCompileException
Description copied from class:CtClassAdds a constructor. To add a class initializer (static constructor), callmakeClassInitializer().- Overrides:
addConstructorin classCtClassType- Throws:
CannotCompileException- See Also:
CtClass.makeClassInitializer()
-
toBytecode
public void toBytecode(java.io.DataOutputStream out) throws CannotCompileException, java.io.IOExceptionDescription copied from class:CtClassConverts this class to a class file. Once this method is called, further modifications are not possible any more.This method dose not close the output stream in the end.
- Overrides:
toBytecodein classCtClassType- Parameters:
out- the output stream that a class file is written to.- Throws:
CannotCompileExceptionjava.io.IOException
-
inheritAllConstructors
public void inheritAllConstructors() throws CannotCompileException, NotFoundExceptionAdds constructors inhrited from the super class.After this method is called, the class inherits all the constructors from the super class. The added constructor calls the super's constructor with the same signature.
-
isInheritable
private boolean isInheritable(int mod, CtClass superclazz)
-
-