Package io.quarkus.gizmo
Class MethodCreatorImpl
java.lang.Object
io.quarkus.gizmo.BytecodeCreatorImpl
io.quarkus.gizmo.MethodCreatorImpl
- All Implemented Interfaces:
AnnotatedElement,BytecodeCreator,MemberCreator<MethodCreator>,MethodCreator,SignatureElement<MethodCreator>,AutoCloseable
- Direct Known Subclasses:
ClassTransfromerMethodCreatorImpl
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.quarkus.gizmo.BytecodeCreatorImpl
BytecodeCreatorImpl.AssignOperation, BytecodeCreatorImpl.BlockOperation, BytecodeCreatorImpl.IfOperation, BytecodeCreatorImpl.InvokeOperation, BytecodeCreatorImpl.JumpOperation, BytecodeCreatorImpl.NewInstanceOperation, BytecodeCreatorImpl.Operation -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<AnnotationCreatorImpl> private final ClassCreatorprivate final Stringprivate final MethodDescriptorprivate intprivate final Map<Integer, MethodCreatorImpl.AnnotationParameters> private String[]private StringFields inherited from class io.quarkus.gizmo.BytecodeCreatorImpl
MAX_STRING_LENGTH, operations -
Constructor Summary
ConstructorsConstructorDescriptionMethodCreatorImpl(BytecodeCreatorImpl enclosing, MethodDescriptor methodDescriptor, String declaringClassName, ClassCreator classCreator) -
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation(String annotationType, RetentionPolicy retentionPolicy) addException(String exception) Adds an exception to the method signature(package private) FunctionCreatorImpladdFunctionBody(ResultHandle instance, ClassCreator cc, MethodCreatorImpl mc, BytecodeCreatorImpl owner) (package private) ClassCreator(package private) ClassOutput(package private) StringintgetParameterAnnotations(int param) (package private) ResultHandle[]resolve(BytecodeCreator owner, ResultHandle... handles) (package private) ResultHandleresolve(ResultHandle handle, BytecodeCreator creator) setModifiers(int mods) voidsetParameterNames(String[] parameterNames) Sets names of all this method's parameters.setSignature(String signature) Use the convenientSignatureBuilderto build signatures for classes, methods and fields.toString()voidwrite(org.objectweb.asm.ClassVisitor file) Methods inherited from class io.quarkus.gizmo.BytecodeCreatorImpl
add, allocateLocalVariables, arrayLength, assign, bitwiseAnd, bitwiseOr, bitwiseXor, breakScope, checkCast, checkScope, checkScope, compareDouble, compareFloat, compareLong, continueScope, convertPrimitive, createFunction, createNewInstanceOp, createScope, createVariable, divide, enumSwitch, findActiveResultHandles, forEach, getBottom, getMethod, getMethodParam, getOwner, getThis, getTop, ifFalse, ifGreaterEqualZero, ifGreaterThanZero, ifIntegerEqual, ifIntegerGreaterEqual, ifIntegerGreaterThan, ifIntegerLessEqual, ifIntegerLessThan, ifLessEqualZero, ifLessThanZero, ifNonZero, ifNotNull, ifNull, ifReferencesEqual, ifReferencesNotEqual, ifThenElse, ifTrue, ifZero, instanceOf, invokeInterfaceMethod, invokeSpecialInterfaceMethod, invokeSpecialMethod, invokeStaticInterfaceMethod, invokeStaticMethod, invokeVirtualMethod, isScopedWithin, jumpTo, load, load, load, load, load, load, load, load, load, loadClass, loadClassFromTCCL, loadNull, loadResultHandle, loadResultHandle, multiply, newArray, newInstance, readArrayValue, readInstanceField, readStaticField, remainder, resolve, resolve, returnValue, storeResultHandle, stringSwitch, subtract, throwException, tryBlock, whileLoop, writeArrayValue, writeInstanceField, writeInteriorOperations, writeOperations, writeStaticFieldMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.quarkus.gizmo.AnnotatedElement
addAnnotation, addAnnotation, addAnnotationMethods inherited from interface io.quarkus.gizmo.BytecodeCreator
add, arrayLength, assign, bitwiseAnd, bitwiseOr, bitwiseXor, breakScope, breakScope, checkCast, checkCast, close, compareDouble, compareFloat, compareLong, continueScope, continueScope, convertPrimitive, createFunction, createScope, createVariable, createVariable, divide, enumSwitch, forEach, getMethodParam, getThis, ifFalse, ifGreaterEqualZero, ifGreaterThanZero, ifIntegerEqual, ifIntegerGreaterEqual, ifIntegerGreaterThan, ifIntegerLessEqual, ifIntegerLessThan, ifLessEqualZero, ifLessThanZero, ifNonZero, ifNotNull, ifNull, ifReferencesEqual, ifReferencesNotEqual, ifThenElse, ifTrue, ifZero, increment, instanceOf, instanceOf, invokeInterfaceMethod, invokeInterfaceMethod, invokeSpecialInterfaceMethod, invokeSpecialInterfaceMethod, invokeSpecialMethod, invokeSpecialMethod, invokeStaticInterfaceMethod, invokeStaticInterfaceMethod, invokeStaticMethod, invokeStaticMethod, invokeVirtualMethod, invokeVirtualMethod, isScopedWithin, load, load, load, load, load, load, load, load, load, load, loadClass, loadClass, loadClass, loadClassFromTCCL, loadClassFromTCCL, loadClassFromTCCL, loadNull, marshalAsArray, multiply, newArray, newArray, newArray, newArray, newInstance, newInstance, readArrayValue, readArrayValue, readInstanceField, readInstanceField, readStaticField, readStaticField, remainder, returnBoolean, returnInt, returnNull, returnValue, returnVoid, stringSwitch, subtract, throwException, throwException, throwException, tryBlock, whileLoop, writeArrayValue, writeArrayValue, writeInstanceField, writeInstanceField, writeStaticField, writeStaticFieldMethods inherited from interface io.quarkus.gizmo.MethodCreator
addException
-
Field Details
-
exceptions
-
annotations
-
parameterAnnotations
-
methodDescriptor
-
declaringClassName
-
classCreator
-
signature
-
modifiers
private int modifiers -
parameterNames
-
-
Constructor Details
-
MethodCreatorImpl
MethodCreatorImpl(BytecodeCreatorImpl enclosing, MethodDescriptor methodDescriptor, String declaringClassName, ClassCreator classCreator)
-
-
Method Details
-
addException
Description copied from interface:MethodCreatorAdds an exception to the method signature- Specified by:
addExceptionin interfaceMethodCreator- Parameters:
exception- The exception- Returns:
- This creator
-
getExceptions
- Specified by:
getExceptionsin interfaceMethodCreator- Returns:
- The exceptions thrown by this method
-
getMethodDescriptor
- Specified by:
getMethodDescriptorin interfaceMethodCreator- Returns:
- The method descriptor
-
getParameterAnnotations
- Specified by:
getParameterAnnotationsin interfaceMethodCreator
-
setParameterNames
Description copied from interface:MethodCreatorSets names of all this method's parameters. The length ofparameterNamesmust be equal to the number of this method's parameters. Removes previously set parameter names ifparameterNamesisnull.It is required to set all parameter names in one go, because parameter names are stored in bytecode as a simple sequence, without positions.
When generating a method with mandated or synthetic parameters (such as an inner class constructor), remember that these parameters must have names too.
- Specified by:
setParameterNamesin interfaceMethodCreator- Parameters:
parameterNames- names of all parameters of this method
-
getModifiers
public int getModifiers()- Specified by:
getModifiersin interfaceMemberCreator<MethodCreator>
-
setModifiers
- Specified by:
setModifiersin interfaceMemberCreator<MethodCreator>
-
write
public void write(org.objectweb.asm.ClassVisitor file) - Specified by:
writein interfaceMemberCreator<MethodCreator>
-
resolve
- Overrides:
resolvein classBytecodeCreatorImpl
-
resolve
- Overrides:
resolvein classBytecodeCreatorImpl
-
toString
-
addAnnotation
- Specified by:
addAnnotationin interfaceAnnotatedElement
-
getDeclaringClassName
String getDeclaringClassName() -
getClassOutput
ClassOutput getClassOutput() -
getClassCreator
ClassCreator getClassCreator() -
addFunctionBody
FunctionCreatorImpl addFunctionBody(ResultHandle instance, ClassCreator cc, MethodCreatorImpl mc, BytecodeCreatorImpl owner) -
getSignature
- Specified by:
getSignaturein interfaceSignatureElement<MethodCreator>
-
setSignature
Description copied from interface:SignatureElementUse the convenientSignatureBuilderto build signatures for classes, methods and fields.- Specified by:
setSignaturein interfaceSignatureElement<MethodCreator>- Parameters:
signature- The generic signature as defined in JVMS 17, chapter "4.7.9.1. Signatures"- Returns:
- the element
- See Also:
-