Package javassist
Class CtNewClass
java.lang.Object
javassist.CtClass
javassist.CtClassType
javassist.CtNewClass
-
Nested Class Summary
Nested classes/interfaces inherited from class javassist.CtClass
CtClass.DelayedFileOutputStream
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionCtNewClass
(String name, ClassPool cp, boolean isInterface, CtClass superclass) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a constructor.protected void
extendToString
(StringBuilder buffer) Implemented in subclasses to add to theCtClass.toString()
result.void
Adds constructors inhrited from the super class.private boolean
isInheritable
(int mod, CtClass superclazz) void
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, isKotlin, isPrimitive, main, makeFileOutput, toBytecode, toClass, toClass, toClass, toClass, toClass, toString, writeFile, writeFile
-
Field Details
-
hasConstructor
protected boolean hasConstructor
-
-
Constructor Details
-
CtNewClass
-
-
Method Details
-
extendToString
Description copied from class:CtClass
Implemented in subclasses to add to theCtClass.toString()
result. Subclasses should put a space before each token added to the buffer.- Overrides:
extendToString
in classCtClassType
-
addConstructor
Description copied from class:CtClass
Adds a constructor. To add a class initializer (static constructor), callmakeClassInitializer()
.- Overrides:
addConstructor
in classCtClassType
- Throws:
CannotCompileException
- See Also:
-
toBytecode
Description copied from class:CtClass
Converts 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:
toBytecode
in classCtClassType
- Parameters:
out
- the output stream that a class file is written to.- Throws:
CannotCompileException
IOException
-
inheritAllConstructors
Adds 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
-