Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.implementation.java
Class AbstractPropertyProcessor<A extends Annotation>

java.lang.Object
  extended by org.apache.tuscany.spi.implementation.java.ImplementationProcessorExtension
      extended by org.apache.tuscany.spi.implementation.java.AbstractPropertyProcessor<A>
All Implemented Interfaces:
ImplementationProcessor

public abstract class AbstractPropertyProcessor<A extends Annotation>
extends ImplementationProcessorExtension

Base class for ImplementationProcessors that handle annotations that add Properties.

Version:
$Rev: 453741 $ $Date: 2006-10-06 12:36:54 -0700 (Fri, 06 Oct 2006) $

Constructor Summary
protected AbstractPropertyProcessor(Class<A> annotationClass, ImplementationProcessorService service)
           
 
Method Summary
protected
<T> JavaMappedProperty<T>
createProperty(String name, Class<T> javaType, Member member)
           
protected abstract  String getName(A annotation)
           
protected
<T> void
initProperty(JavaMappedProperty<T> property, A annotation, CompositeComponent parent, DeploymentContext context)
           
static String toPropertyName(String name)
           
<T> void
visitConstructor(CompositeComponent parent, Constructor<T> constructor, PojoComponentType<JavaMappedService,JavaMappedReference,JavaMappedProperty<?>> type, DeploymentContext context)
          A callback received as the component implementation's constructor used for instantiation by the runtime is evaluated.
 void visitField(CompositeComponent parent, Field field, PojoComponentType<JavaMappedService,JavaMappedReference,JavaMappedProperty<?>> type, DeploymentContext context)
          A callback received as the component implementation's public and protected fields are evaluated
 void visitMethod(CompositeComponent parent, Method method, PojoComponentType<JavaMappedService,JavaMappedReference,JavaMappedProperty<?>> type, DeploymentContext context)
          A callback received as the component implementation's public and protected methods are evaluated
 
Methods inherited from class org.apache.tuscany.spi.implementation.java.ImplementationProcessorExtension
destroy, init, setRegistry, visitClass, visitEnd, visitSuperClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPropertyProcessor

protected AbstractPropertyProcessor(Class<A> annotationClass,
                                    ImplementationProcessorService service)
Method Detail

visitMethod

public void visitMethod(CompositeComponent parent,
                        Method method,
                        PojoComponentType<JavaMappedService,JavaMappedReference,JavaMappedProperty<?>> type,
                        DeploymentContext context)
                 throws ProcessingException
Description copied from interface: ImplementationProcessor
A callback received as the component implementation's public and protected methods are evaluated

Specified by:
visitMethod in interface ImplementationProcessor
Overrides:
visitMethod in class ImplementationProcessorExtension
Parameters:
parent - the parent composite
method - the current public or protected method being evaluated
type - the incomplete component type associated with the implementation class
context - the current deployment context
Throws:
ProcessingException - if an error is encountered while processing metadata

visitField

public void visitField(CompositeComponent parent,
                       Field field,
                       PojoComponentType<JavaMappedService,JavaMappedReference,JavaMappedProperty<?>> type,
                       DeploymentContext context)
                throws ProcessingException
Description copied from interface: ImplementationProcessor
A callback received as the component implementation's public and protected fields are evaluated

Specified by:
visitField in interface ImplementationProcessor
Overrides:
visitField in class ImplementationProcessorExtension
Parameters:
parent - the parent composite
field - the current public or protected field being evaluated
type - the incomplete component type associated with the implementation class
context - the current deployment context
Throws:
ProcessingException - if an error is encountered while processing metadata

visitConstructor

public <T> void visitConstructor(CompositeComponent parent,
                                 Constructor<T> constructor,
                                 PojoComponentType<JavaMappedService,JavaMappedReference,JavaMappedProperty<?>> type,
                                 DeploymentContext context)
                      throws ProcessingException
Description copied from interface: ImplementationProcessor
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 ImplementationProcessor
Overrides:
visitConstructor in class ImplementationProcessorExtension
Parameters:
parent - the parent composite
constructor - the constructor used for instantiating component implementation instances
type - the incomplete component type associated with the implementation class
context - the current deployment context
Throws:
ProcessingException - if an error is encountered while processing metadata

getName

protected abstract String getName(A annotation)

initProperty

protected <T> void initProperty(JavaMappedProperty<T> property,
                                A annotation,
                                CompositeComponent parent,
                                DeploymentContext context)
                     throws ProcessingException
Throws:
ProcessingException

createProperty

protected <T> JavaMappedProperty<T> createProperty(String name,
                                                   Class<T> javaType,
                                                   Member member)
                                        throws ProcessingException
Throws:
ProcessingException

toPropertyName

public static String toPropertyName(String name)

Apache Tuscany SCA Kernel Sub-Project

-