Package io.micronaut.inject.writer
Class ExecutableMethodsDefinitionWriter
java.lang.Object
io.micronaut.inject.writer.ExecutableMethodsDefinitionWriter
- All Implemented Interfaces:
ClassOutputWriter
@Internal
public class ExecutableMethodsDefinitionWriter
extends Object
implements ClassOutputWriter
Writes out a
ExecutableMethodsDefinition
class.- Since:
- 3.0
- Author:
- Denis Stepanov
-
Field Summary
-
Constructor Summary
ConstructorDescriptionExecutableMethodsDefinitionWriter
(EvaluatedExpressionProcessor evaluatedExpressionProcessor, AnnotationMetadata annotationMetadataWithDefaults, String beanDefinitionClassName, String beanDefinitionReferenceClassName, OriginatingElements originatingElements) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ClassWriterOutputVisitor classWriterOutputVisitor) Accept a ClassWriterOutputVisitor to write this writer to disk.io.micronaut.sourcegen.model.ClassTypeDef
boolean
isAbstract
(int index) Is the method abstract.boolean
isDefault
(int index) Is the method a default method.boolean
isInterface
(int index) Is the method in an interface.boolean
Does method support intercepted proxy.boolean
isSuspend
(int index) Is the method suspend.final void
Invoke to build the class model.int
visitExecutableMethod
(TypedElement declaringType, MethodElement methodElement, String interceptedProxyClassName, String interceptedProxyBridgeMethodName) Visit a method that is to be made executable allow invocation of said method without reflection.
-
Field Details
-
CLASS_SUFFIX
- See Also:
-
GET_EXECUTABLE_AT_INDEX_METHOD
-
-
Constructor Details
-
ExecutableMethodsDefinitionWriter
public ExecutableMethodsDefinitionWriter(EvaluatedExpressionProcessor evaluatedExpressionProcessor, AnnotationMetadata annotationMetadataWithDefaults, String beanDefinitionClassName, String beanDefinitionReferenceClassName, OriginatingElements originatingElements)
-
-
Method Details
-
getClassName
- Returns:
- The generated class name.
-
getClassTypeDef
public io.micronaut.sourcegen.model.ClassTypeDef getClassTypeDef()- Returns:
- The generated class type.
-
isSupportsInterceptedProxy
public boolean isSupportsInterceptedProxy()Does method support intercepted proxy.- Returns:
- Does method support intercepted proxy
-
isAbstract
public boolean isAbstract(int index) Is the method abstract.- Parameters:
index
- The method index- Returns:
- Is the method abstract
-
isInterface
public boolean isInterface(int index) Is the method in an interface.- Parameters:
index
- The method index- Returns:
- Is the method in an interface
-
isDefault
public boolean isDefault(int index) Is the method a default method.- Parameters:
index
- The method index- Returns:
- Is the method a default method
-
isSuspend
public boolean isSuspend(int index) Is the method suspend.- Parameters:
index
- The method index- Returns:
- Is the method suspend
-
visitExecutableMethod
public int visitExecutableMethod(TypedElement declaringType, MethodElement methodElement, String interceptedProxyClassName, String interceptedProxyBridgeMethodName) Visit a method that is to be made executable allow invocation of said method without reflection.- Parameters:
declaringType
- The declaring type of the method. Either a Class or a string representing the name of the typemethodElement
- The method elementinterceptedProxyClassName
- The intercepted proxy class nameinterceptedProxyBridgeMethodName
- The intercepted proxy bridge method name- Returns:
- The method index
-
accept
Description copied from interface:ClassOutputWriter
Accept a ClassWriterOutputVisitor to write this writer to disk.- Specified by:
accept
in interfaceClassOutputWriter
- Parameters:
classWriterOutputVisitor
- TheClassWriterOutputVisitor
- Throws:
IOException
- if there is an error writing to disk
-
visitDefinitionEnd
public final void visitDefinitionEnd()Invoke to build the class model.
-