org.apache.tuscany.sca.implementation.java.introspect.impl
Class BaseJavaClassVisitor

java.lang.Object
  extended by org.apache.tuscany.sca.implementation.java.introspect.impl.BaseJavaClassVisitor
All Implemented Interfaces:
JavaClassVisitor
Direct Known Subclasses:
AbstractPropertyProcessor, AllowsPassByReferenceProcessor, ComponentNameProcessor, ConstructorProcessor, ContextProcessor, ConversationIDProcessor, ConversationProcessor, DestroyProcessor, EagerInitProcessor, HeuristicPojoProcessor, InitProcessor, JSR250PolicyProcessor, PolicyProcessor, ReferenceProcessor, ResourceProcessor, ScopeProcessor, ServiceProcessor

public abstract class BaseJavaClassVisitor
extends java.lang.Object
implements JavaClassVisitor

A convenience class for annotation processors which alleviates the need to implement unused callbacks


Field Summary
protected  AssemblyFactory assemblyFactory
           
 
Constructor Summary
protected BaseJavaClassVisitor(AssemblyFactory factory)
           
 
Method Summary
<T> void
visitClass(java.lang.Class<T> clazz, JavaImplementation type)
          A callback received when the component implementation class is first loaded
<T> void
visitConstructor(java.lang.reflect.Constructor<T> constructor, JavaImplementation type)
          A callback received as the component implementation's constructor used for instantiation by the runtime is evaluated.
 void visitConstructorParameter(JavaParameterImpl parameter, JavaImplementation type)
           
<T> void
visitEnd(java.lang.Class<T> clazz, JavaImplementation type)
          The final callback received when all other callbacks during evaluation of the component implementation have been issued
 void visitField(java.lang.reflect.Field field, JavaImplementation type)
          A callback received as the component implementation's public and protected fields are evaluated
 void visitMethod(java.lang.reflect.Method method, JavaImplementation type)
          A callback received as the component implementation's public and protected methods are evaluated
<T> void
visitSuperClass(java.lang.Class<T> clazz, JavaImplementation type)
          A callback received as the component implementation class hierarchy is evaluated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

assemblyFactory

protected AssemblyFactory assemblyFactory
Constructor Detail

BaseJavaClassVisitor

protected BaseJavaClassVisitor(AssemblyFactory factory)
Method Detail

visitClass

public <T> void visitClass(java.lang.Class<T> clazz,
                           JavaImplementation type)
                throws IntrospectionException
Description copied from interface: JavaClassVisitor
A callback received when the component implementation class is first loaded

Specified by:
visitClass in interface JavaClassVisitor
Parameters:
clazz - the component implementation class
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitSuperClass

public <T> void visitSuperClass(java.lang.Class<T> clazz,
                                JavaImplementation type)
                     throws IntrospectionException
Description copied from interface: JavaClassVisitor
A callback received as the component implementation class hierarchy is evaluated

Specified by:
visitSuperClass in interface JavaClassVisitor
Parameters:
clazz - the superclass in the component implmentation's class hierarchy
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitMethod

public void visitMethod(java.lang.reflect.Method method,
                        JavaImplementation type)
                 throws IntrospectionException
Description copied from interface: JavaClassVisitor
A callback received as the component implementation's public and protected methods are evaluated

Specified by:
visitMethod in interface JavaClassVisitor
Parameters:
method - the current public or protected method being evaluated
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitConstructor

public <T> void visitConstructor(java.lang.reflect.Constructor<T> constructor,
                                 JavaImplementation type)
                      throws IntrospectionException
Description copied from interface: JavaClassVisitor
A callback received as the component implementation's constructor used for instantiation by the runtime is evaluated. If an implementation contains more than one constructor, the constructor passed to the callback will be chosen according to the algorithm described in the SCA Java Client and Implementation Model Specification.

Specified by:
visitConstructor in interface JavaClassVisitor
Parameters:
constructor - the constructor used for instantiating component implementation instances
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitField

public void visitField(java.lang.reflect.Field field,
                       JavaImplementation type)
                throws IntrospectionException
Description copied from interface: JavaClassVisitor
A callback received as the component implementation's public and protected fields are evaluated

Specified by:
visitField in interface JavaClassVisitor
Parameters:
field - the current public or protected field being evaluated
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitEnd

public <T> void visitEnd(java.lang.Class<T> clazz,
                         JavaImplementation type)
              throws IntrospectionException
Description copied from interface: JavaClassVisitor
The final callback received when all other callbacks during evaluation of the component implementation have been issued

Specified by:
visitEnd in interface JavaClassVisitor
Parameters:
clazz - the component implementation class
type - the incomplete component type associated with the implementation class
Throws:
IntrospectionException - if an error is encountered while processing metadata

visitConstructorParameter

public void visitConstructorParameter(JavaParameterImpl parameter,
                                      JavaImplementation type)
                               throws IntrospectionException
Specified by:
visitConstructorParameter in interface JavaClassVisitor
Throws:
IntrospectionException