Package io.quarkus.gizmo
Class ClassCreator
java.lang.Object
io.quarkus.gizmo.ClassCreator
- All Implemented Interfaces:
AnnotatedElement,SignatureElement<ClassCreator>,AutoCloseable
public class ClassCreator
extends Object
implements AutoCloseable, AnnotatedElement, SignatureElement<ClassCreator>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final AtomicIntegerprivate final List<AnnotationCreatorImpl> private final Stringprivate final ClassOutputprivate final BytecodeCreatorImplprivate final Map<FieldDescriptor, FieldCreatorImpl> private final String[]private final Map<MethodDescriptor, MethodCreatorImpl> private Stringprivate final Stringprivate final Map<MethodDescriptor, MethodDescriptor> -
Constructor Summary
ConstructorsConstructorDescriptionClassCreator(BytecodeCreatorImpl enclosing, ClassOutput classOutput, String name, String signature, String superClass, int access, String... interfaces) ClassCreator(ClassOutput classOutput, String name, String signature, String superClass, String... interfaces) -
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation(String annotationType, RetentionPolicy retentionPolicy) static ClassCreator.Builderbuilder()voidclose()Finish the class creator.(package private) ClassOutputgetConstructorCreator(Class<?>... parameters) getConstructorCreator(String... parameters) getFieldCreator(FieldDescriptor fieldDescriptor) getFieldCreator(String name, Object type) getFieldCreator(String name, String type) String[]getMethodCreator(MethodDescriptor methodDescriptor) getMethodCreator(String name, Class<?> returnType, Class<?>... parameters) getMethodCreator(String name, Object returnType, Object... parameters) getMethodCreator(String name, String returnType, String... parameters) (package private) MethodDescriptorgetSupertypeAccessor(MethodDescriptor descriptor, String supertype, boolean isInterface) static ClassCreator.BuilderbooleansetSignature(String signature) Use the convenientSignatureBuilderto build signatures for classes, methods and fields.voidwriteTo(ClassOutput classOutput) Write the class bytes to the given class output.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.gizmo.AnnotatedElement
addAnnotation, addAnnotation, addAnnotation
-
Field Details
-
enclosing
-
classOutput
-
superClass
-
access
private final int access -
interfaces
-
methods
-
fields
-
annotations
-
className
-
signature
-
superclassAccessors
-
accessorCount
-
-
Constructor Details
-
ClassCreator
ClassCreator(BytecodeCreatorImpl enclosing, ClassOutput classOutput, String name, String signature, String superClass, int access, String... interfaces) -
ClassCreator
public ClassCreator(ClassOutput classOutput, String name, String signature, String superClass, String... interfaces)
-
-
Method Details
-
builder
-
interfaceBuilder
-
getConstructorCreator
-
getConstructorCreator
-
getMethodCreator
-
getMethodCreator
-
getMethodCreator
-
getMethodCreator
-
getFieldCreator
-
getFieldCreator
-
getFieldCreator
-
getSuperClass
-
getInterfaces
-
getClassName
-
getSimpleClassName
-
isInterface
public boolean isInterface() -
getSupertypeAccessor
MethodDescriptor getSupertypeAccessor(MethodDescriptor descriptor, String supertype, boolean isInterface) -
writeTo
Write the class bytes to the given class output.- Parameters:
classOutput- the class output (must not benull)
-
close
public void close()Finish the class creator. If a class output was configured for this class creator, the class bytes will immediately be written there.- Specified by:
closein interfaceAutoCloseable
-
addAnnotation
- Specified by:
addAnnotationin interfaceAnnotatedElement
-
getSignature
- Specified by:
getSignaturein interfaceSignatureElement<ClassCreator>
-
setSignature
Description copied from interface:SignatureElementUse the convenientSignatureBuilderto build signatures for classes, methods and fields.- Specified by:
setSignaturein interfaceSignatureElement<ClassCreator>- Parameters:
signature- The generic signature as defined in JVMS 17, chapter "4.7.9.1. Signatures"- Returns:
- the element
- See Also:
-
getExistingMethods
-
getExistingFields
-
getClassOutput
ClassOutput getClassOutput()
-