public class AopProxyWriter extends AbstractClassFileWriter implements ProxyingBeanDefinitionVisitor, Toggleable
Modifier and Type | Field and Description |
---|---|
static String |
FIELD_BEAN_RESOLUTION_CONTEXT |
static String |
FIELD_READ_LOCK |
static String |
FIELD_READ_WRITE_LOCK |
static String |
FIELD_TARGET |
static org.objectweb.asm.Type |
FIELD_TYPE_INTERCEPTORS |
static String |
FIELD_WRITE_LOCK |
static int |
MAX_LOCALS |
static org.objectweb.asm.commons.Method |
METHOD_GET_PROXY_TARGET |
static org.objectweb.asm.commons.Method |
METHOD_GET_PROXY_TARGET_BEAN |
static org.objectweb.asm.commons.Method |
METHOD_GET_PROXY_TARGET_BEAN_WITH_CONTEXT |
static org.objectweb.asm.commons.Method |
METHOD_HAS_CACHED_INTERCEPTED_METHOD |
static org.objectweb.asm.Type |
TYPE_BEAN_LOCATOR |
static org.objectweb.asm.Type |
TYPE_DEFAULT_BEAN_CONTEXT |
static org.objectweb.asm.Type |
TYPE_INTERCEPTOR_CHAIN |
static org.objectweb.asm.Type |
TYPE_LOCK |
static org.objectweb.asm.Type |
TYPE_METHOD_INTERCEPTOR_CHAIN |
static org.objectweb.asm.Type |
TYPE_READ_WRITE_LOCK |
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
PROXY_SUFFIX
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, V9
Constructor and Description |
---|
AopProxyWriter(BeanDefinitionWriter parent,
OptionalValues<Boolean> settings,
ConfigurationMetadataBuilder<?> metadataBuilder,
VisitorContext visitorContext,
AnnotationValue<?>... interceptorBinding)
Constructs a new
AopProxyWriter for the given parent BeanDefinitionWriter and starting interceptors types. |
AopProxyWriter(String packageName,
String className,
boolean isInterface,
boolean implementInterface,
Element originatingElement,
AnnotationMetadata annotationMetadata,
ClassElement[] interfaceTypes,
VisitorContext visitorContext,
ConfigurationMetadataBuilder<?> metadataBuilder,
ConfigurationMetadata configurationMetadata,
AnnotationValue<?>... interceptorBinding)
Constructs a new
AopProxyWriter for the purposes of writing Introduction advise. |
AopProxyWriter(String packageName,
String className,
boolean isInterface,
Element originatingElement,
AnnotationMetadata annotationMetadata,
ClassElement[] interfaceTypes,
VisitorContext visitorContext,
ConfigurationMetadataBuilder<?> metadataBuilder,
ConfigurationMetadata configurationMetadata,
AnnotationValue<?>... interceptorBinding)
Constructs a new
AopProxyWriter for the purposes of writing Introduction advise. |
Modifier and Type | Method and Description |
---|---|
void |
accept(ClassWriterOutputVisitor visitor)
Write the class to output via a visitor that manages output destination.
|
AnnotationMetadata |
getAnnotationMetadata() |
String |
getBeanDefinitionName() |
String |
getBeanDefinitionReferenceClassName() |
String |
getBeanSimpleName() |
String |
getBeanTypeName() |
Optional<org.objectweb.asm.Type> |
getInterceptedType() |
Element |
getOriginatingElement()
Deprecated.
|
String |
getPackageName() |
org.objectweb.asm.Type |
getProvidedType()
The provided type of the bean.
|
String |
getProxiedBeanDefinitionName() |
String |
getProxiedTypeName() |
ClassElement[] |
getTypeArguments() |
boolean |
isEnabled() |
boolean |
isInterface() |
boolean |
isProxyTarget()
Is the target bean being proxied.
|
boolean |
isSingleton() |
boolean |
isValidated() |
boolean |
requiresMethodProcessing()
By default, when the
BeanContext is started, the
BeanDefinition.getExecutableMethods() are not processed by registered
ExecutableMethodProcessor instances unless this method returns true. |
void |
setInterceptedType(String typeName)
Sets the name of the intercepted type.
|
void |
setRequiresMethodProcessing(boolean shouldPreProcess)
Sets whether the
BeanType.requiresMethodProcessing() returns true. |
void |
setValidated(boolean validated)
Make the bean definition as validated by javax.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 |
visitBeanDefinitionEnd()
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 with
Bean 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 with
Bean 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 with
Bean this method should be called. |
void |
visitConfigBuilderDurationMethod(String prefix,
ClassElement returnType,
String methodName,
String propertyPath)
Visit a configuration builder method that accepts a long and a TimeUnit.
|
void |
visitConfigBuilderEnd()
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 prefix,
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)
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 a 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,
boolean requiresReflection,
boolean isOptional)
Visits an injection point for a setter.
|
void |
visitSuperBeanDefinition(String name)
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 |
writeTo(File compilationDir)
Write the proxy to the given compilation directory.
|
addOriginatingElement, buildArgument, buildArgument, buildArgumentWithGenerics, buildArgumentWithGenerics, generateServiceDescriptor, getClassFileName, getConstructorDescriptor, getConstructorDescriptor, getConstructorDescriptor, getInternalName, getInternalNameForCast, getInternalNameForCast, getInternalNameForCast, getMethodDescriptor, getMethodDescriptor, getMethodDescriptor, getMethodDescriptor, getMethodDescriptorForReturnType, getMethodSignature, getObjectType, getOriginatingElements, getTypeDescriptor, getTypeDescriptor, getTypeDescriptor, getTypeDescriptor, getTypeReference, getTypeReferenceForName, getTypes, implementInterceptedTypeMethod, invokeConstructor, invokeInterfaceStaticMethod, invokeMethod, newClassWriterOutputVisitor, pushBoxPrimitiveIfNecessary, pushBoxPrimitiveIfNecessary, pushBoxPrimitiveIfNecessary, pushBuildArgumentsForMethod, pushCastToType, pushCastToType, pushCastToType, pushCreateArgument, pushMethodNameAndTypesArguments, pushNewArray, pushNewArray, pushNewInstance, pushReturnTypeArgument, pushReturnValue, pushStoreInArray, pushStoreInArray, pushStoreStringInArray, pushStoreTypeInArray, pushStringMapOf, pushTypeArgumentElements, returnVoid, startClass, startConstructor, startConstructor, startFinalClass, startProtectedMethod, startPublicClass, startPublicFinalClass, startPublicFinalMethodZeroArgs, startPublicMethod, startPublicMethod, startPublicMethodZeroArgs, startService, startService, visitStaticInitializer, writeBooleanMethod, writeClassToDisk, writeClassToDisk
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addOriginatingElement, getOriginatingElements, of
public static final int MAX_LOCALS
public static final org.objectweb.asm.commons.Method METHOD_GET_PROXY_TARGET
public static final org.objectweb.asm.commons.Method METHOD_GET_PROXY_TARGET_BEAN_WITH_CONTEXT
public static final org.objectweb.asm.commons.Method METHOD_GET_PROXY_TARGET_BEAN
public static final org.objectweb.asm.commons.Method METHOD_HAS_CACHED_INTERCEPTED_METHOD
public static final org.objectweb.asm.Type FIELD_TYPE_INTERCEPTORS
public static final org.objectweb.asm.Type TYPE_INTERCEPTOR_CHAIN
public static final org.objectweb.asm.Type TYPE_METHOD_INTERCEPTOR_CHAIN
public static final String FIELD_TARGET
public static final String FIELD_BEAN_RESOLUTION_CONTEXT
public static final String FIELD_READ_WRITE_LOCK
public static final org.objectweb.asm.Type TYPE_READ_WRITE_LOCK
public static final String FIELD_READ_LOCK
public static final String FIELD_WRITE_LOCK
public static final org.objectweb.asm.Type TYPE_LOCK
public static final org.objectweb.asm.Type TYPE_BEAN_LOCATOR
public static final org.objectweb.asm.Type TYPE_DEFAULT_BEAN_CONTEXT
public AopProxyWriter(BeanDefinitionWriter parent, OptionalValues<Boolean> settings, ConfigurationMetadataBuilder<?> metadataBuilder, VisitorContext visitorContext, AnnotationValue<?>... interceptorBinding)
Constructs a new AopProxyWriter
for the given parent BeanDefinitionWriter
and starting interceptors types.
Additional Interceptor
types can be added downstream with visitInterceptorBinding(AnnotationValue[])
.
parent
- The parent BeanDefinitionWriter
settings
- optional settingmetadataBuilder
- The configuration metadata buildervisitorContext
- The visitor contextinterceptorBinding
- The interceptor binding of the Interceptor
instances to be injectedpublic AopProxyWriter(String packageName, String className, boolean isInterface, Element originatingElement, AnnotationMetadata annotationMetadata, ClassElement[] interfaceTypes, VisitorContext visitorContext, ConfigurationMetadataBuilder<?> metadataBuilder, ConfigurationMetadata configurationMetadata, AnnotationValue<?>... interceptorBinding)
AopProxyWriter
for the purposes of writing Introduction
advise.packageName
- The package nameclassName
- The class nameisInterface
- Is the target of the advise an interfaceoriginatingElement
- The originating elementannotationMetadata
- The annotation metadatainterfaceTypes
- The additional interfaces to implementvisitorContext
- The visitor contextmetadataBuilder
- The configuration metadata builderconfigurationMetadata
- The configuration metadata for the classinterceptorBinding
- The interceptor typespublic AopProxyWriter(String packageName, String className, boolean isInterface, boolean implementInterface, Element originatingElement, AnnotationMetadata annotationMetadata, ClassElement[] interfaceTypes, VisitorContext visitorContext, ConfigurationMetadataBuilder<?> metadataBuilder, ConfigurationMetadata configurationMetadata, AnnotationValue<?>... interceptorBinding)
AopProxyWriter
for the purposes of writing Introduction
advise.packageName
- The package nameclassName
- The class nameisInterface
- Is the target of the advise an interfaceimplementInterface
- Whether the interface should be implemented. If false the interfaceTypes
argument should contain at least one entryoriginatingElement
- The originating elementsannotationMetadata
- The annotation metadatainterfaceTypes
- The additional interfaces to implementvisitorContext
- The visitor contextmetadataBuilder
- The configuration metadata builderconfigurationMetadata
- The configuration metadata for the classinterceptorBinding
- The interceptor bindingpublic boolean isEnabled()
isEnabled
in interface Toggleable
public boolean isProxyTarget()
protected void startClass(org.objectweb.asm.ClassVisitor classWriter, String className, org.objectweb.asm.Type superType)
startClass
in class AbstractClassFileWriter
classWriter
- The current class writerclassName
- The class namesuperType
- The super type@Deprecated public Element getOriginatingElement()
getOriginatingElement
in interface BeanDefinitionVisitor
getOriginatingElement
in class AbstractClassFileWriter
public void visitBeanFactoryMethod(ClassElement factoryClass, MethodElement factoryMethod)
BeanDefinitionVisitor
In the case where the produced class is produced by a factory method annotated with
Bean
this method should be called.
visitBeanFactoryMethod
in interface BeanDefinitionVisitor
factoryClass
- The factory classfactoryMethod
- The factory methodpublic void visitBeanFactoryMethod(ClassElement factoryClass, MethodElement factoryMethod, ParameterElement[] parameters)
BeanDefinitionVisitor
In the case where the produced class is produced by a factory method annotated with
Bean
this method should be called.
visitBeanFactoryMethod
in interface BeanDefinitionVisitor
factoryClass
- The factory classfactoryMethod
- The factory methodparameters
- The parameterspublic void visitBeanFactoryField(ClassElement factoryClass, FieldElement factoryField)
BeanDefinitionVisitor
In the case where the produced class is produced by a factory field annotated with
Bean
this method should be called.
visitBeanFactoryField
in interface BeanDefinitionVisitor
factoryClass
- The factory classfactoryField
- The factory fieldpublic boolean isSingleton()
isSingleton
in interface BeanDefinitionVisitor
public boolean isInterface()
isInterface
in interface BeanDefinitionVisitor
public void visitBeanDefinitionInterface(Class<? extends BeanDefinition> interfaceType)
BeanDefinitionVisitor
visitBeanDefinitionInterface
in interface BeanDefinitionVisitor
interfaceType
- The interface typepublic String getBeanTypeName()
getBeanTypeName
in interface BeanDefinitionVisitor
public org.objectweb.asm.Type getProvidedType()
BeanDefinitionVisitor
BeanDefinitionVisitor.getBeanTypeName()
, except in the case of
factory beans which produce a different type.getProvidedType
in interface BeanDefinitionVisitor
public void setValidated(boolean validated)
BeanDefinitionVisitor
setValidated
in interface BeanDefinitionVisitor
validated
- Whether the bean definition is validatedpublic void setInterceptedType(String typeName)
BeanDefinitionVisitor
setInterceptedType
in interface BeanDefinitionVisitor
typeName
- The type namepublic Optional<org.objectweb.asm.Type> getInterceptedType()
getInterceptedType
in interface BeanDefinitionVisitor
public boolean isValidated()
isValidated
in interface BeanDefinitionVisitor
public String getBeanDefinitionName()
getBeanDefinitionName
in interface BeanDefinitionVisitor
public void visitBeanDefinitionConstructor(MethodElement constructor, boolean requiresReflection, VisitorContext visitorContext)
visitBeanDefinitionConstructor
in interface BeanDefinitionVisitor
constructor
- The constructorrequiresReflection
- Whether reflection is requiredvisitorContext
- The visitor contextpublic void visitDefaultConstructor(AnnotationMetadata annotationMetadata, VisitorContext visitorContext)
BeanDefinitionVisitor
visitDefaultConstructor
in interface BeanDefinitionVisitor
annotationMetadata
- The annotation metadata for the constructorvisitorContext
- The visitor context@NonNull public String getBeanDefinitionReferenceClassName()
getBeanDefinitionReferenceClassName
in interface BeanDefinitionVisitor
public void visitIntroductionMethod(TypedElement declaringBean, MethodElement methodElement)
declaringBean
- The declaring bean of the method.methodElement
- The method elementpublic void visitAroundMethod(TypedElement beanType, MethodElement methodElement)
beanType
- The bean type.methodElement
- The method elementpublic void visitBeanDefinitionEnd()
writeTo(File)
visitBeanDefinitionEnd
in interface BeanDefinitionVisitor
public void writeTo(File compilationDir) throws IOException
writeTo
in interface BeanDefinitionVisitor
writeTo
in class AbstractClassFileWriter
compilationDir
- The target compilation directoryIOException
- If an error occurs writing the file@NonNull public ClassElement[] getTypeArguments()
getTypeArguments
in interface BeanDefinitionVisitor
public void accept(ClassWriterOutputVisitor visitor) throws IOException
accept
in interface BeanDefinitionVisitor
accept
in interface ClassOutputWriter
visitor
- the writer output visitorIOException
- If an error occurspublic void visitSuperBeanDefinition(String name)
BeanDefinitionVisitor
AbstractBeanDefinition
.visitSuperBeanDefinition
in interface BeanDefinitionVisitor
name
- The super typepublic void visitSuperBeanDefinitionFactory(String beanName)
BeanDefinitionVisitor
visitSuperBeanDefinitionFactory
in interface BeanDefinitionVisitor
beanName
- The bean namepublic void visitSetterValue(TypedElement declaringType, MethodElement methodElement, boolean requiresReflection, boolean isOptional)
BeanDefinitionVisitor
visitSetterValue
in interface BeanDefinitionVisitor
declaringType
- The declaring typemethodElement
- The method elementrequiresReflection
- Whether the setter requires reflectionisOptional
- Whether the setter is optionalpublic void visitPostConstructMethod(TypedElement declaringType, MethodElement methodElement, boolean requiresReflection, VisitorContext visitorContext)
BeanDefinitionVisitor
visitPostConstructMethod
in interface BeanDefinitionVisitor
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 contextpublic void visitPreDestroyMethod(TypedElement declaringType, MethodElement methodElement, boolean requiresReflection, VisitorContext visitorContext)
BeanDefinitionVisitor
visitPreDestroyMethod
in interface BeanDefinitionVisitor
declaringType
- The bean type of the methodmethodElement
- The method elementrequiresReflection
- Whether the method requires reflectionvisitorContext
- The visitor contextpublic void visitMethodInjectionPoint(TypedElement beanType, MethodElement methodElement, boolean requiresReflection, VisitorContext visitorContext)
BeanDefinitionVisitor
visitMethodInjectionPoint
in interface BeanDefinitionVisitor
beanType
- The bean type of the methodmethodElement
- The method elementrequiresReflection
- Whether the method requires reflectionvisitorContext
- The visitor contextpublic int visitExecutableMethod(TypedElement declaringBean, MethodElement methodElement, VisitorContext visitorContext)
BeanDefinitionVisitor
visitExecutableMethod
in interface BeanDefinitionVisitor
declaringBean
- The declaring bean of the method. Note this may differ from MemberElement.getDeclaringType()
in the case of the method coming from a super class or interface.methodElement
- The method elementvisitorContext
- The visitor contextpublic void visitFieldInjectionPoint(TypedElement declaringType, FieldElement fieldType, boolean requiresReflection)
BeanDefinitionVisitor
visitFieldInjectionPoint
in interface BeanDefinitionVisitor
declaringType
- The declaring type. Either a Class or a string representing the name of the typefieldType
- The field elementrequiresReflection
- Whether accessing the field requires reflectionpublic void visitAnnotationMemberPropertyInjectionPoint(TypedElement annotationMemberBeanType, String annotationMemberProperty, String requiredValue, String notEqualsValue)
BeanDefinitionVisitor
visitAnnotationMemberPropertyInjectionPoint
in interface BeanDefinitionVisitor
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 loadedpublic void visitFieldValue(TypedElement declaringType, FieldElement fieldType, boolean requiresReflection, boolean isOptional)
BeanDefinitionVisitor
visitFieldValue
in interface BeanDefinitionVisitor
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 optionalpublic String getPackageName()
getPackageName
in interface BeanDefinitionVisitor
public String getBeanSimpleName()
getBeanSimpleName
in interface BeanDefinitionVisitor
public AnnotationMetadata getAnnotationMetadata()
getAnnotationMetadata
in interface BeanDefinitionVisitor
public void visitConfigBuilderField(ClassElement type, String field, AnnotationMetadata annotationMetadata, ConfigurationMetadataBuilder metadataBuilder, boolean isInterface)
BeanDefinitionVisitor
visitConfigBuilderField
in interface BeanDefinitionVisitor
type
- The type of the builderfield
- The name of the field that represents the builderannotationMetadata
- The annotation metadata associated with the fieldmetadataBuilder
- The ConfigurationMetadataBuilder
isInterface
- Whether the builder type is an interface or notConfigurationBuilder
public void visitConfigBuilderMethod(ClassElement type, String methodName, AnnotationMetadata annotationMetadata, ConfigurationMetadataBuilder metadataBuilder, boolean isInterface)
BeanDefinitionVisitor
visitConfigBuilderMethod
in interface BeanDefinitionVisitor
type
- The type of the buildermethodName
- The name of the method that returns the builderannotationMetadata
- The annotation metadata associated with the fieldmetadataBuilder
- The ConfigurationMetadataBuilder
isInterface
- Whether the builder type is an interface or notConfigurationBuilder
public void visitConfigBuilderMethod(String prefix, ClassElement returnType, String methodName, ClassElement paramType, Map<String,ClassElement> generics, String propertyPath)
BeanDefinitionVisitor
visitConfigBuilderMethod
in interface BeanDefinitionVisitor
prefix
- The prefix used for the methodreturnType
- The return typemethodName
- The method nameparamType
- The method typegenerics
- The generic types of the methodpropertyPath
- The property pathConfigurationBuilder
public void visitConfigBuilderDurationMethod(String prefix, ClassElement returnType, String methodName, String propertyPath)
BeanDefinitionVisitor
visitConfigBuilderDurationMethod
in interface BeanDefinitionVisitor
prefix
- The prefix used for the methodreturnType
- The return typemethodName
- The method namepropertyPath
- The property pathConfigurationBuilder
public void visitConfigBuilderEnd()
BeanDefinitionVisitor
visitConfigBuilderEnd
in interface BeanDefinitionVisitor
ConfigurationBuilder
public void setRequiresMethodProcessing(boolean shouldPreProcess)
BeanDefinitionVisitor
BeanType.requiresMethodProcessing()
returns true.setRequiresMethodProcessing
in interface BeanDefinitionVisitor
shouldPreProcess
- True if they should be pre-processedpublic void visitTypeArguments(Map<String,Map<String,ClassElement>> typeArguments)
BeanDefinitionVisitor
visitTypeArguments
in interface BeanDefinitionVisitor
typeArguments
- The type argumentspublic boolean requiresMethodProcessing()
BeanDefinitionVisitor
BeanContext
is started, the
BeanDefinition.getExecutableMethods()
are not processed by registered
ExecutableMethodProcessor
instances unless this method returns true.requiresMethodProcessing
in interface BeanDefinitionVisitor
Executable.processOnStartup()
public String getProxiedTypeName()
getProxiedTypeName
in interface ProxyingBeanDefinitionVisitor
public String getProxiedBeanDefinitionName()
getProxiedBeanDefinitionName
in interface ProxyingBeanDefinitionVisitor
public void visitInterceptorBinding(AnnotationValue<?>... interceptorBinding)
interceptorBinding
- the interceptor binding