- All Superinterfaces:
AnnotatableCreator,MethodTyped,ModifiableCreator,Typed,TypeParameterizedCreator
- All Known Subinterfaces:
AbstractMethodCreator,ConstructorCreator,InstanceExecutableCreator,InstanceMethodCreator,MethodCreator,StaticExecutableCreator,StaticMethodCreator
public sealed interface ExecutableCreator
extends MethodTyped, TypeParameterizedCreator, ModifiableCreator
permits InstanceExecutableCreator, MethodCreator, StaticExecutableCreator (not exhaustive)
A creator for an executable (i.e. something that can be called with arguments).
-
Method Summary
Modifier and TypeMethodDescriptiondefault ParamVarAdd a parameter.default ParamVarAdd a parameter at the given position.default ParamVarparameter(String name, int position, GenericType type) Add a parameter.default ParamVarAdd a parameter.default ParamVarAdd a parameter.parameter(String name, int position, Consumer<ParamCreator> builder) Add a parameter at the given position.default ParamVarparameter(String name, GenericType type) Add a parameter.default ParamVarAdd a parameter.default ParamVarAdd a parameter.parameter(String name, Consumer<ParamCreator> builder) Add a parameter.voidsetType(MethodTypeDesc desc) Establish the type of this executable.voidthrows_(GenericType.OfThrows throwableType) Declare that this method throws exceptions of the given type.default voidDeclare that this method throws exceptions of the given type.default voidDeclare that this method throws exceptions of the given type.type()Returns the type descriptor of this executable (notnull).default voidvarargs()Add the variable arguments modifier flag to this creator.Methods inherited from interface io.quarkus.gizmo2.creator.AnnotatableCreator
addAnnotation, addAnnotation, addAnnotation, addAnnotationMethods inherited from interface io.quarkus.gizmo2.MethodTyped
genericReturnType, hasGenericReturnType, isPrimitiveParameter, isPrimitiveReturn, isVoidReturn, parameterCount, parameterSlotSize, parameterType, parameterTypeKind, parameterTypes, returnSlotSize, returnType, returnTypeKindMethods inherited from interface io.quarkus.gizmo2.creator.ModifiableCreator
addFlag, addFlags, addFlags, final_, modifierLocation, packagePrivate, private_, protected_, public_, removeFlag, removeFlags, removeFlags, setAccess, supports, syntheticMethods inherited from interface io.quarkus.gizmo2.creator.TypeParameterizedCreator
typeParameter, typeParameter
-
Method Details
-
type
MethodTypeDesc type()Returns the type descriptor of this executable (notnull).- Specified by:
typein interfaceMethodTyped- Specified by:
typein interfaceTyped- Returns:
- the type descriptor of this executable (not
null)
-
setType
Establish the type of this executable. Created parameters will be required to conform to this type. If some parameters have already been created, then their types must match their corresponding types in the given descriptor.- Parameters:
desc- the executable type (must not benull)- Throws:
IllegalStateException- if the executable type has already been establishedIllegalArgumentException- if some parameters are already defined, and their types do not match the given type descriptor
-
parameter
Add a parameter. If the method type has not yet been established, it is changed to include the new parameter. If the method type is already set, then any type given to the new parameter must match the type of the next parameter of the method type.- Parameters:
name- the parameter name (must not benull)builder- the parameter builder (must not benull)- Returns:
- the parameter variable (not
null) - Throws:
IllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established type
-
parameter
Add a parameter at the given position. If the method type has not yet been established, it is changed to include the new parameter. If the method type is already set, then any type given to the new parameter must match the type of the corresponding parameter of the method type.- Parameters:
name- the parameter name (must not benull)position- the parameter position, counting up from zero (not includingthis)builder- the parameter builder (must not benull)- Returns:
- the parameter variable (not
null) - Throws:
IllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established typeIndexOutOfBoundsException- if the parameter position is out of range
-
parameter
Add a parameter. If the method type has not yet been established, an exception is thrown. If the method type is already set, then the new parameter will be given the type of the next parameter of the method type.- Parameters:
name- the parameter name (must not benull)- Returns:
- the parameter variable (not
null) - Throws:
IllegalStateException- if the type of this executable has not yet been established, or if the parameter with the next position has already been declaredIllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established type
-
parameter
Add a parameter at the given position. If the method type has not yet been established, an exception is thrown. If the method type is already set, then the new parameter will be given the type of the next parameter of the method type.- Parameters:
name- the parameter name (must not benull)position- the parameter position, counting up from zero (not includingthis)- Returns:
- the parameter variable (not
null) - Throws:
IllegalStateException- if the type of this executable has not yet been established, or if the parameter with the given position has already been declaredIllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established typeIndexOutOfBoundsException- if the parameter position is out of range
-
parameter
Add a parameter. If the method type has not yet been established, it is changed to include the new parameter. If the method type is already set, then the given type must match the type of the next parameter of the method type.- Parameters:
name- the parameter name (must not benull)type- the parameter type (must not benull)- Returns:
- the parameter variable (not
null) - Throws:
IllegalStateException- if the type of this executable has not yet been established, or if the parameter with the next position has already been declaredIllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established type
-
parameter
Add a parameter. If the method type has not yet been established, it is changed to include the new parameter, and the position must correspond to the next unset parameter. If the method type is already set, then the given type must match the type of the corresponding parameter of the method type.- Parameters:
name- the parameter name (must not benull)type- the parameter type (must not benull)- Returns:
- the parameter variable (not
null) - Throws:
IllegalStateException- if the type of this executable has not yet been established, or if the parameter with the given position has already been declaredIllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established typeIndexOutOfBoundsException- if the parameter position is out of range
-
parameter
Add a parameter. If the method type has not yet been established, it is changed to include the new parameter. If the method type is already set, then the given type must match the type of the next parameter of the method type.- Parameters:
name- the parameter name (must not benull)type- the parameter type (must not benull)- Returns:
- the parameter variable (not
null) - Throws:
IllegalStateException- if the type of this executable has not yet been established, or if the parameter with the next position has already been declaredIllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established type
-
parameter
Add a parameter. If the method type has not yet been established, it is changed to include the new parameter, and the position must correspond to the next unset parameter. If the method type is already set, then the given type must match the type of the corresponding parameter of the method type.- Parameters:
name- the parameter name (must not benull)type- the parameter type (must not benull)- Returns:
- the parameter variable (not
null) - Throws:
IllegalStateException- if the type of this executable has not yet been established, or if the parameter with the given position has already been declaredIllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established typeIndexOutOfBoundsException- if the parameter position is out of range
-
parameter
Add a parameter. If the method type has not yet been established, it is changed to include the new parameter. If the method type is already set, then the given type must match the type of the next parameter of the method type.- Parameters:
name- the parameter name (must not benull)type- the parameter type (must not benull)- Returns:
- the parameter variable (not
null) - Throws:
IllegalStateException- if the type of this executable has not yet been established, or if the parameter with the next position has already been declaredIllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established type
-
parameter
Add a parameter. If the method type has not yet been established, it is changed to include the new parameter, and the position must correspond to the next unset parameter. If the method type is already set, then the given type must match the type of the corresponding parameter of the method type.- Parameters:
name- the parameter name (must not benull)type- the parameter type (must not benull)- Returns:
- the parameter variable (not
null) - Throws:
IllegalStateException- if the type of this executable has not yet been established, or if the parameter with the given position has already been declaredIllegalArgumentException- if the type does not match the corresponding parameter type in the established method type, or if the number of parameters exceeds the number of parameters in the established typeIndexOutOfBoundsException- if the parameter position is out of range
-
throws_
Declare that this method throws exceptions of the given type.- Parameters:
throwableType- the generic exception type (must not benull)
-
throws_
Declare that this method throws exceptions of the given type.- Parameters:
throwableType- the exception type (must not benull)
-
throws_
Declare that this method throws exceptions of the given type.- Parameters:
throwableType- the exception type (must not benull)
-
varargs
default void varargs()Add the variable arguments modifier flag to this creator.
-