Package io.micronaut.aop.writer
Class AopProxyWriter
java.lang.Object
io.micronaut.inject.writer.AbstractClassFileWriter
io.micronaut.aop.writer.AopProxyWriter
- All Implemented Interfaces:
Toggleable
,BeanDefinitionVisitor
,ClassOutputWriter
,OriginatingElements
,ProxyingBeanDefinitionVisitor
,org.objectweb.asm.Opcodes
@Internal
public class AopProxyWriter
extends AbstractClassFileWriter
implements ProxyingBeanDefinitionVisitor, Toggleable
A class that generates AOP proxy classes at compile time.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from class io.micronaut.inject.writer.AbstractClassFileWriter
ARRAY_PATTERN, CONSTRUCTOR_NAME, DEFAULT_MAX_STACK, DESCRIPTOR_DEFAULT_CONSTRUCTOR, METHOD_CREATE_ARGUMENT_SIMPLE, METHOD_CREATE_TYPE_VARIABLE_SIMPLE, METHOD_DEFAULT_CONSTRUCTOR, METHOD_GENERIC_PLACEHOLDER_SIMPLE, originatingElements, TYPE_ARGUMENT, TYPE_ARGUMENT_ARRAY, TYPE_CLASS, TYPE_GENERATED, TYPE_OBJECT, ZERO_ARGUMENTS_CONSTANT
Fields inherited from interface io.micronaut.inject.writer.BeanDefinitionVisitor
PROXY_SUFFIX
Fields inherited from interface org.objectweb.asm.Opcodes
AALOAD, AASTORE, ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_DEPRECATED, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_MANDATED, ACC_MODULE, ACC_NATIVE, ACC_OPEN, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_RECORD, ACC_STATIC, ACC_STATIC_PHASE, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_TRANSITIVE, ACC_VARARGS, ACC_VOLATILE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASM10_EXPERIMENTAL, ASM4, ASM5, ASM6, ASM7, ASM8, ASM9, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DMUL, DNEG, DOUBLE, DREM, DRETURN, DSTORE, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F_APPEND, F_CHOP, F_FULL, F_NEW, F_SAME, F_SAME1, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FLOAT, FMUL, FNEG, FREM, FRETURN, FSTORE, FSUB, GETFIELD, GETSTATIC, GOTO, H_GETFIELD, H_GETSTATIC, H_INVOKEINTERFACE, H_INVOKESPECIAL, H_INVOKESTATIC, H_INVOKEVIRTUAL, H_NEWINVOKESPECIAL, H_PUTFIELD, H_PUTSTATIC, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, IMUL, INEG, INSTANCEOF, INTEGER, INVOKEDYNAMIC, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, JSR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDIV, LLOAD, LMUL, LNEG, LONG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, NULL, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SOURCE_DEPRECATED, SOURCE_MASK, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH, TOP, UNINITIALIZED_THIS, V_PREVIEW, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V10, V11, V12, V13, V14, V15, V16, V17, V18, V19, V20, V21, V22, V23, V9
-
Constructor Summary
ConstructorDescriptionAopProxyWriter
(BeanDefinitionWriter parent, OptionalValues<Boolean> settings, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a newAopProxyWriter
for the given parentBeanDefinitionWriter
and starting interceptors types.AopProxyWriter
(String packageName, String className, boolean isInterface, boolean implementInterface, Element originatingElement, AnnotationMetadata annotationMetadata, ClassElement[] interfaceTypes, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a newAopProxyWriter
for the purposes of writingIntroduction
advise.AopProxyWriter
(String packageName, String className, boolean isInterface, Element originatingElement, AnnotationMetadata annotationMetadata, ClassElement[] interfaceTypes, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a newAopProxyWriter
for the purposes of writingIntroduction
advise. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ClassWriterOutputVisitor visitor) Write the class to output via a visitor that manages output destination.static int
findInterceptorsListParameterIndex
(List<ParameterElement> parameters) Find the interceptors list constructor parameter index.Optional<org.objectweb.asm.Type>
org.objectweb.asm.Type
The provided type of the bean.boolean
boolean
boolean
Is the target bean being proxied.boolean
boolean
boolean
By default, when theBeanContext
is started, theBeanDefinition.getExecutableMethods()
are not processed by registeredExecutableMethodProcessor
instances unless this method returns true.void
setInterceptedType
(String typeName) Sets the name of the intercepted type.void
setRequiresMethodProcessing
(boolean shouldPreProcess) Sets whether theBeanType.requiresMethodProcessing()
returns true.void
setValidated
(boolean validated) Make the bean definition as validated by jakarta.validation.protected void
startClass
(org.objectweb.asm.ClassVisitor classWriter, String className, org.objectweb.asm.Type superType) void
visitAnnotationMemberPropertyInjectionPoint
(TypedElement annotationMemberBeanType, String annotationMemberProperty, String requiredValue, String notEqualsValue) Visits an annotation injection point.void
visitAroundMethod
(TypedElement beanType, MethodElement methodElement) Visit a method that is to be proxied.void
visitBeanDefinitionConstructor
(MethodElement constructor, boolean requiresReflection, VisitorContext visitorContext) Visits a constructor.void
Finalizes the proxy.void
visitBeanDefinitionInterface
(Class<? extends BeanDefinition> interfaceType) Visit a marker interface on the generated bean definition.void
visitBeanFactoryField
(ClassElement factoryClass, FieldElement factoryField) In the case where the produced class is produced by a factory field annotated withBean
this method should be called.void
visitBeanFactoryMethod
(ClassElement factoryClass, MethodElement factoryMethod) In the case where the produced class is produced by a factory method annotated withBean
this method should be called.void
visitBeanFactoryMethod
(ClassElement factoryClass, MethodElement factoryMethod, ParameterElement[] parameters) In the case where the produced class is produced by a factory method annotated withBean
this method should be called.void
visitConfigBuilderDurationMethod
(String propertyName, ClassElement returnType, String methodName, String propertyPath) Visit a configuration builder method that accepts a long and a TimeUnit.void
Finalize a configuration builder field.void
visitConfigBuilderField
(ClassElement type, String field, AnnotationMetadata annotationMetadata, ConfigurationMetadataBuilder metadataBuilder, boolean isInterface) Begin defining a configuration builder.void
visitConfigBuilderMethod
(ClassElement type, String methodName, AnnotationMetadata annotationMetadata, ConfigurationMetadataBuilder metadataBuilder, boolean isInterface) Begin defining a configuration builder.void
visitConfigBuilderMethod
(String propertyName, ClassElement returnType, String methodName, ClassElement paramType, Map<String, ClassElement> generics, String propertyPath) Visit a configuration builder method.void
visitDefaultConstructor
(AnnotationMetadata annotationMetadata, VisitorContext visitorContext) Visits the constructor used to create the bean definition in the case where no constructor is present.int
visitExecutableMethod
(TypedElement declaringBean, MethodElement methodElement, VisitorContext visitorContext) Visit a method that is to be made executable allow invocation of said method without reflection.void
visitFieldInjectionPoint
(TypedElement declaringType, FieldElement fieldType, boolean requiresReflection, VisitorContext visitorContext) Visits a field injection point.void
visitFieldValue
(TypedElement declaringType, FieldElement fieldType, boolean requiresReflection, boolean isOptional) Visits a field injection point.void
visitInterceptorBinding
(AnnotationValue<?>... interceptorBinding) visitInterceptorTypes.void
visitIntroductionMethod
(TypedElement declaringBean, MethodElement methodElement) Visit an abstract method that is to be implemented.void
visitMethodInjectionPoint
(TypedElement beanType, MethodElement methodElement, boolean requiresReflection, VisitorContext visitorContext) Visits a method injection point.void
visitPostConstructMethod
(TypedElement declaringType, MethodElement methodElement, boolean requiresReflection, VisitorContext visitorContext) Visits a method injection point.void
visitPreDestroyMethod
(TypedElement declaringType, MethodElement methodElement, boolean requiresReflection, VisitorContext visitorContext) Visits a method injection point.void
visitSetterValue
(TypedElement declaringType, MethodElement methodElement, AnnotationMetadata annotationMetadata, boolean requiresReflection, boolean isOptional) Visits an injection point for a setter.void
Alter the super class of this bean definition.void
visitSuperBeanDefinitionFactory
(String beanName) Alter the super class of this bean definition to use another factory bean.void
visitTypeArguments
(Map<String, Map<String, ClassElement>> typeArguments) Visits the type arguments for the bean.void
Write the proxy to the given compilation directory.Methods inherited from class io.micronaut.inject.writer.AbstractClassFileWriter
addOriginatingElement, annotateAsGeneratedAndService, buildArgument, buildArgument, buildArgumentWithGenerics, buildArgumentWithGenerics, getConstructorDescriptor, getConstructorDescriptor, getConstructorDescriptor, getInternalName, getMethodDescriptor, getMethodDescriptor, getMethodDescriptor, getMethodDescriptor, getMethodDescriptorForReturnType, getMethodSignature, getObjectType, getOriginatingElement, getOriginatingElements, getTypeDescriptor, getTypeDescriptor, getTypeDescriptor, getTypeDescriptor, getTypeReference, getTypeReferenceForName, implementInterceptedTypeMethod, invokeConstructor, invokeInterfaceStaticMethod, newClassWriterOutputVisitor, pushBoxPrimitiveIfNecessary, pushBoxPrimitiveIfNecessary, pushBoxPrimitiveIfNecessary, pushBuildArgumentsForMethod, pushCastFromObjectToType, pushCastToType, pushCastToType, pushCastToType, pushCastToType, pushCreateArgument, pushCreateArgument, pushListOfString, pushMethodNameAndTypesArguments, pushNewArray, pushNewArray, pushNewArray, pushNewArray, pushNewArray, pushNewArrayIndexed, pushNewInstance, pushReturnTypeArgument, pushStoreInArray, pushStoreInArray, pushStringMapOf, pushTypeArgumentElements, startConstructor, startConstructor, startProtectedMethod, startPublicClass, startPublicFinalMethodZeroArgs, startPublicMethod, startPublicMethod, startPublicMethod, startPublicMethodZeroArgs, startService, startService, toTypeString, visitStaticInitializer, writeClassToDisk
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.inject.writer.BeanDefinitionVisitor
getOriginatingElement, isProxiedBean
Methods inherited from interface io.micronaut.inject.writer.OriginatingElements
addOriginatingElement, getOriginatingElements
-
Field Details
-
ADDITIONAL_PARAMETERS_COUNT
public static final int ADDITIONAL_PARAMETERS_COUNT- See Also:
-
-
Constructor Details
-
AopProxyWriter
public AopProxyWriter(BeanDefinitionWriter parent, OptionalValues<Boolean> settings, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a new
AopProxyWriter
for the given parentBeanDefinitionWriter
and starting interceptors types.Additional
Interceptor
types can be added downstream withvisitInterceptorBinding(AnnotationValue[])
.- Parameters:
parent
- The parentBeanDefinitionWriter
settings
- optional settingvisitorContext
- The visitor contextinterceptorBinding
- The interceptor binding of theInterceptor
instances to be injected
-
AopProxyWriter
public AopProxyWriter(String packageName, String className, boolean isInterface, Element originatingElement, AnnotationMetadata annotationMetadata, ClassElement[] interfaceTypes, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a newAopProxyWriter
for the purposes of writingIntroduction
advise.- Parameters:
packageName
- The package nameclassName
- The class nameisInterface
- Is the target of the advice an interfaceoriginatingElement
- The originating elementannotationMetadata
- The annotation metadatainterfaceTypes
- The additional interfaces to implementvisitorContext
- The visitor contextinterceptorBinding
- The interceptor types
-
AopProxyWriter
public AopProxyWriter(String packageName, String className, boolean isInterface, boolean implementInterface, Element originatingElement, AnnotationMetadata annotationMetadata, ClassElement[] interfaceTypes, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding) Constructs a newAopProxyWriter
for the purposes of writingIntroduction
advise.- Parameters:
packageName
- The package nameclassName
- The class nameisInterface
- Is the target of the advice an interfaceimplementInterface
- Whether the interface should be implemented. If false theinterfaceTypes
argument should contain at least one entryoriginatingElement
- The originating elementsannotationMetadata
- The annotation metadatainterfaceTypes
- The additional interfaces to implementvisitorContext
- The visitor contextinterceptorBinding
- The interceptor binding
-
-
Method Details
-
findInterceptorsListParameterIndex
Find the interceptors list constructor parameter index.- Parameters:
parameters
- The constructor parameters- Returns:
- the index
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceToggleable
- Returns:
- Whether the component is enabled
-
isProxyTarget
public boolean isProxyTarget()Is the target bean being proxied.- Specified by:
isProxyTarget
in interfaceBeanDefinitionVisitor
- Returns:
- True if the target bean is being proxied
-
startClass
protected void startClass(org.objectweb.asm.ClassVisitor classWriter, String className, org.objectweb.asm.Type superType) - Overrides:
startClass
in classAbstractClassFileWriter
- Parameters:
classWriter
- The current class writerclassName
- The class namesuperType
- The super type
-
visitBeanFactoryMethod
Description copied from interface:BeanDefinitionVisitor
In the case where the produced class is produced by a factory method annotated with
Bean
this method should be called.- Specified by:
visitBeanFactoryMethod
in interfaceBeanDefinitionVisitor
- Parameters:
factoryClass
- The factory classfactoryMethod
- The factory method
-
visitBeanFactoryMethod
public void visitBeanFactoryMethod(ClassElement factoryClass, MethodElement factoryMethod, ParameterElement[] parameters) Description copied from interface:BeanDefinitionVisitor
In the case where the produced class is produced by a factory method annotated with
Bean
this method should be called.- Specified by:
visitBeanFactoryMethod
in interfaceBeanDefinitionVisitor
- Parameters:
factoryClass
- The factory classfactoryMethod
- The factory methodparameters
- The parameters
-
visitBeanFactoryField
Description copied from interface:BeanDefinitionVisitor
In the case where the produced class is produced by a factory field annotated with
Bean
this method should be called.- Specified by:
visitBeanFactoryField
in interfaceBeanDefinitionVisitor
- Parameters:
factoryClass
- The factory classfactoryField
- The factory field
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceBeanDefinitionVisitor
- Returns:
- Is the bean singleton
-
isInterface
public boolean isInterface()- Specified by:
isInterface
in interfaceBeanDefinitionVisitor
- Returns:
- Whether the provided type an interface
-
visitBeanDefinitionInterface
Description copied from interface:BeanDefinitionVisitor
Visit a marker interface on the generated bean definition.- Specified by:
visitBeanDefinitionInterface
in interfaceBeanDefinitionVisitor
- Parameters:
interfaceType
- The interface type
-
getBeanTypeName
- Specified by:
getBeanTypeName
in interfaceBeanDefinitionVisitor
- Returns:
- The full class name of the bean
-
getProvidedType
public org.objectweb.asm.Type getProvidedType()Description copied from interface:BeanDefinitionVisitor
The provided type of the bean. Usually this is the same asBeanDefinitionVisitor.getBeanTypeName()
, except in the case of factory beans which produce a different type.- Specified by:
getProvidedType
in interfaceBeanDefinitionVisitor
- Returns:
- The provided type
-
setValidated
public void setValidated(boolean validated) Description copied from interface:BeanDefinitionVisitor
Make the bean definition as validated by jakarta.validation.- Specified by:
setValidated
in interfaceBeanDefinitionVisitor
- Parameters:
validated
- Whether the bean definition is validated
-
setInterceptedType
Description copied from interface:BeanDefinitionVisitor
Sets the name of the intercepted type.- Specified by:
setInterceptedType
in interfaceBeanDefinitionVisitor
- Parameters:
typeName
- The type name
-
getInterceptedType
- Specified by:
getInterceptedType
in interfaceBeanDefinitionVisitor
- Returns:
- The intercepted type
-
isValidated
public boolean isValidated()- Specified by:
isValidated
in interfaceBeanDefinitionVisitor
- Returns:
- Return whether the bean definition is validated.
-
getBeanDefinitionName
- Specified by:
getBeanDefinitionName
in interfaceBeanDefinitionVisitor
- Returns:
- The name of the bean definition class
-
visitBeanDefinitionConstructor
public void visitBeanDefinitionConstructor(MethodElement constructor, boolean requiresReflection, VisitorContext visitorContext) Visits a constructor.- Specified by:
visitBeanDefinitionConstructor
in interfaceBeanDefinitionVisitor
- Parameters:
constructor
- The constructorrequiresReflection
- Whether reflection is requiredvisitorContext
- The visitor context
-
visitDefaultConstructor
public void visitDefaultConstructor(AnnotationMetadata annotationMetadata, VisitorContext visitorContext) Description copied from interface:BeanDefinitionVisitor
Visits the constructor used to create the bean definition in the case where no constructor is present. This method should only be called in the class defines no constructor.- Specified by:
visitDefaultConstructor
in interfaceBeanDefinitionVisitor
- Parameters:
annotationMetadata
- The annotation metadata for the constructorvisitorContext
- The visitor context
-
getBeanDefinitionReferenceClassName
- Specified by:
getBeanDefinitionReferenceClassName
in interfaceBeanDefinitionVisitor
- Returns:
- The name of the bean definition reference class.
-
visitIntroductionMethod
Visit an abstract method that is to be implemented.- Parameters:
declaringBean
- The declaring bean of the method.methodElement
- The method element
-
visitAroundMethod
Visit a method that is to be proxied.- Parameters:
beanType
- The bean type.methodElement
- The method element
-
visitBeanDefinitionEnd
public void visitBeanDefinitionEnd()Finalizes the proxy. This method should be called before writing the proxy to disk withwriteTo(File)
- Specified by:
visitBeanDefinitionEnd
in interfaceBeanDefinitionVisitor
-
writeTo
Write the proxy to the given compilation directory.- Specified by:
writeTo
in interfaceBeanDefinitionVisitor
- Overrides:
writeTo
in classAbstractClassFileWriter
- Parameters:
compilationDir
- The target compilation directory- Throws:
IOException
- If an error occurs writing the file
-
getTypeArguments
- Specified by:
getTypeArguments
in interfaceBeanDefinitionVisitor
- Returns:
- The generic type arguments for the bean type.
-
getTypeArgumentMap
- Specified by:
getTypeArgumentMap
in interfaceBeanDefinitionVisitor
- Returns:
- A map of the type arguments for the bean.
-
accept
Write the class to output via a visitor that manages output destination.- Specified by:
accept
in interfaceBeanDefinitionVisitor
- Specified by:
accept
in interfaceClassOutputWriter
- Parameters:
visitor
- the writer output visitor- Throws:
IOException
- If an error occurs
-
visitSuperBeanDefinition
Description copied from interface:BeanDefinitionVisitor
Alter the super class of this bean definition. The passed class should be a subclass ofAbstractInitializableBeanDefinition
.- Specified by:
visitSuperBeanDefinition
in interfaceBeanDefinitionVisitor
- Parameters:
name
- The super type
-
visitSuperBeanDefinitionFactory
Description copied from interface:BeanDefinitionVisitor
Alter the super class of this bean definition to use another factory bean.- Specified by:
visitSuperBeanDefinitionFactory
in interfaceBeanDefinitionVisitor
- Parameters:
beanName
- The bean name
-
visitSetterValue
public void visitSetterValue(TypedElement declaringType, MethodElement methodElement, AnnotationMetadata annotationMetadata, boolean requiresReflection, boolean isOptional) Description copied from interface:BeanDefinitionVisitor
Visits an injection point for a setter.- Specified by:
visitSetterValue
in interfaceBeanDefinitionVisitor
- Parameters:
declaringType
- The declaring typemethodElement
- The method elementannotationMetadata
- The annotationMetadatarequiresReflection
- Whether the setter requires reflectionisOptional
- Whether the setter is optional
-
visitPostConstructMethod
public void visitPostConstructMethod(TypedElement declaringType, MethodElement methodElement, boolean requiresReflection, VisitorContext visitorContext) Description copied from interface:BeanDefinitionVisitor
Visits a method injection point.- Specified by:
visitPostConstructMethod
in interfaceBeanDefinitionVisitor
- Parameters:
declaringType
- The declaring type of the method. Either a Class or a string representing the name of the typemethodElement
- The method elementrequiresReflection
- Whether the method requires reflectionvisitorContext
- The visitor context
-
visitPreDestroyMethod
public void visitPreDestroyMethod(TypedElement declaringType, MethodElement methodElement, boolean requiresReflection, VisitorContext visitorContext) Description copied from interface:BeanDefinitionVisitor
Visits a method injection point.- Specified by:
visitPreDestroyMethod
in interfaceBeanDefinitionVisitor
- Parameters:
declaringType
- The bean type of the methodmethodElement
- The method elementrequiresReflection
- Whether the method requires reflectionvisitorContext
- The visitor context
-
visitMethodInjectionPoint
public void visitMethodInjectionPoint(TypedElement beanType, MethodElement methodElement, boolean requiresReflection, VisitorContext visitorContext) Description copied from interface:BeanDefinitionVisitor
Visits a method injection point.- Specified by:
visitMethodInjectionPoint
in interfaceBeanDefinitionVisitor
- Parameters:
beanType
- The bean type of the methodmethodElement
- The method elementrequiresReflection
- Whether the method requires reflectionvisitorContext
- The visitor context
-
visitExecutableMethod
public int visitExecutableMethod(TypedElement declaringBean, MethodElement methodElement, VisitorContext visitorContext) Description copied from interface:BeanDefinitionVisitor
Visit a method that is to be made executable allow invocation of said method without reflection.- Specified by:
visitExecutableMethod
in interfaceBeanDefinitionVisitor
- Parameters:
declaringBean
- The declaring bean of the method. Note this may differ fromMemberElement.getDeclaringType()
in the case of the method coming from a super class or interface.methodElement
- The method elementvisitorContext
- The visitor context- Returns:
- The index of a new method
-
visitFieldInjectionPoint
public void visitFieldInjectionPoint(TypedElement declaringType, FieldElement fieldType, boolean requiresReflection, VisitorContext visitorContext) Description copied from interface:BeanDefinitionVisitor
Visits a field injection point.- Specified by:
visitFieldInjectionPoint
in interfaceBeanDefinitionVisitor
- Parameters:
declaringType
- The declaring type. Either a Class or a string representing the name of the typefieldType
- The field elementrequiresReflection
- Whether accessing the field requires reflectionvisitorContext
- The visitor context
-
visitAnnotationMemberPropertyInjectionPoint
public void visitAnnotationMemberPropertyInjectionPoint(TypedElement annotationMemberBeanType, String annotationMemberProperty, String requiredValue, String notEqualsValue) Description copied from interface:BeanDefinitionVisitor
Visits an annotation injection point.- Specified by:
visitAnnotationMemberPropertyInjectionPoint
in interfaceBeanDefinitionVisitor
- Parameters:
annotationMemberBeanType
- The type of the injected beanannotationMemberProperty
- Required property of the injected beanrequiredValue
- Required value of the bean property for the bean to be loadednotEqualsValue
- The bean property value which should not be equal to present value for the bean to be loaded
-
visitFieldValue
public void visitFieldValue(TypedElement declaringType, FieldElement fieldType, boolean requiresReflection, boolean isOptional) Description copied from interface:BeanDefinitionVisitor
Visits a field injection point.- Specified by:
visitFieldValue
in interfaceBeanDefinitionVisitor
- Parameters:
declaringType
- The declaring type. Either a Class or a string representing the name of the typefieldType
- The field elementrequiresReflection
- Whether accessing the field requires reflectionisOptional
- Is the value optional
-
getPackageName
- Specified by:
getPackageName
in interfaceBeanDefinitionVisitor
- Returns:
- The package name of the bean
-
getBeanSimpleName
- Specified by:
getBeanSimpleName
in interfaceBeanDefinitionVisitor
- Returns:
- The short name of the bean
-
getAnnotationMetadata
- Specified by:
getAnnotationMetadata
in interfaceBeanDefinitionVisitor
- Returns:
- The annotation metadata
-
visitConfigBuilderField
public void visitConfigBuilderField(ClassElement type, String field, AnnotationMetadata annotationMetadata, ConfigurationMetadataBuilder metadataBuilder, boolean isInterface) Description copied from interface:BeanDefinitionVisitor
Begin defining a configuration builder.- Specified by:
visitConfigBuilderField
in interfaceBeanDefinitionVisitor
- Parameters:
type
- The type of the builderfield
- The name of the field that represents the builderannotationMetadata
- The annotation metadata associated with the fieldmetadataBuilder
- TheConfigurationMetadataBuilder
isInterface
- Whether the builder type is an interface or not- See Also:
-
visitConfigBuilderMethod
public void visitConfigBuilderMethod(ClassElement type, String methodName, AnnotationMetadata annotationMetadata, ConfigurationMetadataBuilder metadataBuilder, boolean isInterface) Description copied from interface:BeanDefinitionVisitor
Begin defining a configuration builder.- Specified by:
visitConfigBuilderMethod
in interfaceBeanDefinitionVisitor
- Parameters:
type
- The type of the buildermethodName
- The name of the method that returns the builderannotationMetadata
- The annotation metadata associated with the fieldmetadataBuilder
- TheConfigurationMetadataBuilder
isInterface
- Whether the builder type is an interface or not- See Also:
-
visitConfigBuilderMethod
public void visitConfigBuilderMethod(String propertyName, ClassElement returnType, String methodName, ClassElement paramType, Map<String, ClassElement> generics, String propertyPath) Description copied from interface:BeanDefinitionVisitor
Visit a configuration builder method.- Specified by:
visitConfigBuilderMethod
in interfaceBeanDefinitionVisitor
- Parameters:
propertyName
- The property namereturnType
- The return typemethodName
- The method nameparamType
- The method typegenerics
- The generic types of the methodpropertyPath
- The property path- See Also:
-
visitConfigBuilderDurationMethod
public void visitConfigBuilderDurationMethod(String propertyName, ClassElement returnType, String methodName, String propertyPath) Description copied from interface:BeanDefinitionVisitor
Visit a configuration builder method that accepts a long and a TimeUnit.- Specified by:
visitConfigBuilderDurationMethod
in interfaceBeanDefinitionVisitor
- Parameters:
propertyName
- The property namereturnType
- The return typemethodName
- The method namepropertyPath
- The property path- See Also:
-
visitConfigBuilderEnd
public void visitConfigBuilderEnd()Description copied from interface:BeanDefinitionVisitor
Finalize a configuration builder field.- Specified by:
visitConfigBuilderEnd
in interfaceBeanDefinitionVisitor
- See Also:
-
setRequiresMethodProcessing
public void setRequiresMethodProcessing(boolean shouldPreProcess) Description copied from interface:BeanDefinitionVisitor
Sets whether theBeanType.requiresMethodProcessing()
returns true.- Specified by:
setRequiresMethodProcessing
in interfaceBeanDefinitionVisitor
- Parameters:
shouldPreProcess
- True if they should be pre-processed
-
visitTypeArguments
Description copied from interface:BeanDefinitionVisitor
Visits the type arguments for the bean.- Specified by:
visitTypeArguments
in interfaceBeanDefinitionVisitor
- Parameters:
typeArguments
- The type arguments
-
requiresMethodProcessing
public boolean requiresMethodProcessing()Description copied from interface:BeanDefinitionVisitor
By default, when theBeanContext
is started, theBeanDefinition.getExecutableMethods()
are not processed by registeredExecutableMethodProcessor
instances unless this method returns true.- Specified by:
requiresMethodProcessing
in interfaceBeanDefinitionVisitor
- Returns:
- Whether the bean definition requires method processing
- See Also:
-
getProxiedTypeName
- Specified by:
getProxiedTypeName
in interfaceProxyingBeanDefinitionVisitor
- Returns:
- The fully qualified name of the class being proxied
-
getProxiedBeanDefinitionName
- Specified by:
getProxiedBeanDefinitionName
in interfaceProxyingBeanDefinitionVisitor
- Returns:
- The bean definition that is proxied
-
visitInterceptorBinding
visitInterceptorTypes.- Parameters:
interceptorBinding
- the interceptor binding
-