Package io.quarkus.gizmo
Interface MethodCreator
-
- All Superinterfaces:
AnnotatedElement,java.lang.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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default MethodCreatoraddException(java.lang.Class<?> exception)Adds an exception to the method signatureMethodCreatoraddException(java.lang.String exception)Adds an exception to the method signaturejava.util.List<java.lang.String>getExceptions()MethodDescriptorgetMethodDescriptor()AnnotatedElementgetParameterAnnotations(int param)voidsetParameterNames(java.lang.String[] parameterNames)Sets names of all this method's parameters.-
Methods inherited from interface io.quarkus.gizmo.AnnotatedElement
addAnnotation, addAnnotation, addAnnotation, addAnnotation
-
Methods 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, writeStaticField
-
Methods inherited from interface io.quarkus.gizmo.MemberCreator
getModifiers, setModifiers, write
-
Methods inherited from interface io.quarkus.gizmo.SignatureElement
getSignature, setSignature
-
-
-
-
Method Detail
-
addException
MethodCreator addException(java.lang.String exception)
Adds an exception to the method signature- Parameters:
exception- The exception- Returns:
- This creator
-
addException
default MethodCreator addException(java.lang.Class<?> exception)
Adds an exception to the method signature- Parameters:
exception- The exception- Returns:
- This creator
-
getExceptions
java.util.List<java.lang.String> getExceptions()
- Returns:
- The exceptions thrown by this method
-
getMethodDescriptor
MethodDescriptor getMethodDescriptor()
- Returns:
- The method descriptor
-
getParameterAnnotations
AnnotatedElement getParameterAnnotations(int param)
-
setParameterNames
void setParameterNames(java.lang.String[] parameterNames)
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
-
-