Package io.quarkus.gizmo
Interface MethodCreator
- All Superinterfaces:
AnnotatedElement,AutoCloseable,BytecodeCreator,MemberCreator<MethodCreator>,SignatureElement<MethodCreator>
- All Known Implementing Classes:
ClassTransfromerMethodCreatorImpl,MethodCreatorImpl
public interface MethodCreator
extends MemberCreator<MethodCreator>, BytecodeCreator, AnnotatedElement, SignatureElement<MethodCreator>
A class that builds the body of a method without needing to understand java bytecode.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MethodCreatoraddException(Class<?> exception) Adds an exception to the method signatureaddException(String exception) Adds an exception to the method signaturegetParameterAnnotations(int param) voidsetParameterNames(String[] parameterNames) Sets names of all this method's parameters.Methods inherited from interface io.quarkus.gizmo.AnnotatedElement
addAnnotation, 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.MemberCreator
getModifiers, setModifiers, writeMethods inherited from interface io.quarkus.gizmo.SignatureElement
getSignature, setSignature
-
Method Details
-
addException
Adds an exception to the method signature- Parameters:
exception- The exception- Returns:
- This creator
-
addException
Adds an exception to the method signature- Parameters:
exception- The exception- Returns:
- This creator
-
getExceptions
- Returns:
- The exceptions thrown by this method
-
getMethodDescriptor
MethodDescriptor getMethodDescriptor()- Returns:
- The method descriptor
-
getParameterAnnotations
-
setParameterNames
Sets 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.
- Parameters:
parameterNames- names of all parameters of this method
-