Top Fields Constructors Methods
javassist

pack-priv Class CtNewClass

extends CtClassType
Class Inheritance
Imports
java.io.DataOutputStream, .IOException, javassist.bytecode.ClassFile

Field Summary

Modifier and TypeField and Description
protected boolean
Inherited from javassist.CtClassType:
classfileclassPoolgcConstPoolrawClassfilewasChangedwasPruned

Constructor Summary

AccessConstructor and Description
pack-priv
CtNewClass(String name, ClassPool cp, boolean isInterface, CtClass superclass)

Method Summary

Modifier and TypeMethod and Description
public void
protected void
extendToString(StringBuilder buffer)

Overrides javassist.CtClassType.extendToString.

Implemented in subclasses to add to the toString() result.

public void
inheritAllConstructors()

Adds constructors inhrited from the super class.

private boolean
isInheritable(int mod, CtClass superclazz)

public void
toBytecode(DataOutputStream
the output stream that a class file is written to.
out
)

Overrides javassist.CtClassType.toBytecode.

Converts this class to a class file.

Inherited from javassist.CtClassType:
addFieldaddFieldaddInterfaceaddMethodcheckModifycompressdefrostfreezegetAccessorMakergetAnnotationgetAnnotationsgetAnnotationTypegetAttributegetAvailableAnnotationsgetClassFile2getClassFile3getClassInitializergetClassPoolgetConstructorgetConstructorsgetDeclaredBehaviorsgetDeclaredConstructorsgetDeclaredFieldgetDeclaredFieldgetDeclaredFieldsgetDeclaredMethodgetDeclaredMethodgetDeclaredMethodsgetDeclaredMethodsgetDeclaringClassgetEnclosingBehaviorgetFieldgetField2getFieldsgetGenericSignaturegetHiddenMethodsgetInterfacesgetMembersgetMethodgetMethodsgetModifiersgetNestedClassesgetSuperclassgetUniqueNumbergetURLhasAnnotationhasAnnotationTypehasAnnotationTypehasMemberCacheincGetCounterinstrumentinstrumentisAnnotationisEnumisFrozenisInterfaceisModifiedmakeClassInitializermakeNestedClassmakeUniqueNameprunerebuildClassFileremoveConstructorremoveFieldremoveMethodreplaceClassNamereplaceClassNamesetAttributesetClassPoolsetGenericSignaturesetInterfacessetModifierssetNamesetSuperclassstopPruningsubclassOfsubtypeOftoAnnotationTypetoAnnotationType

Field Detail

hasConstructorback to summary
protected boolean hasConstructor

Constructor Detail

CtNewClassback to summary
pack-priv CtNewClass(String name, ClassPool cp, boolean isInterface, CtClass superclass)

Method Detail

addConstructorback to summary
public void addConstructor(CtConstructor c) throws CannotCompileException

Overrides javassist.CtClassType.addConstructor.

Doc from javassist.CtClass.addConstructor.

Adds a constructor. To add a class initializer (static constructor), call makeClassInitializer().

Annotations
@Override
extendToStringback to summary
protected void extendToString(StringBuilder buffer)

Overrides javassist.CtClassType.extendToString.

Doc from javassist.CtClass.extendToString.

Implemented in subclasses to add to the toString() result. Subclasses should put a space before each token added to the buffer.

Annotations
@Override
inheritAllConstructorsback to summary
public void inheritAllConstructors() throws CannotCompileException, NotFoundException

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.

isInheritableback to summary
private boolean isInheritable(int mod, CtClass superclazz)
toBytecodeback to summary
public void toBytecode(DataOutputStream out) throws CannotCompileException, IOException

Overrides javassist.CtClassType.toBytecode.

Doc from javassist.CtClass.toBytecode.

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.

Parameters
out:DataOutputStream

the output stream that a class file is written to.

Annotations
@Override