org.peaseplate.service
Interface TransformerService

All Known Implementing Classes:
DefaultTransformerService

public interface TransformerService

The transformer service stores and hold predefined transformers.

Author:
Manfred HANTSCHEL

Method Summary
 void add(java.lang.Class<?> transformerClass)
          Adds the transformer specified by the class.
 void add(java.lang.ClassLoader... classLoaders)
          Scans the specified class loaders for transformer service definitions.
 void add(java.lang.Object transformer)
          Adds the specified transformer class.
 java.lang.Object getInstance(java.lang.String name)
           
 java.lang.reflect.Method getMethod(java.lang.String name, java.lang.String extension, int numberOfParameters)
           
 

Method Detail

add

void add(java.lang.ClassLoader... classLoaders)
Scans the specified class loaders for transformer service definitions. The definitions are located in a resource with the name "META-INF/services/org.peaseplate.service.TransformerService". The file contains class names of transformers, one class name per line. The name of the transformers will be the name of each class trimming "Transformer" and "Transformers" at the end. This can be overruled by using the Transformer annotation. The class must contains at lease one method annotated as Transformer or DefaultTransformer and conform the following rules:

Parameters:
classLoaders - the class loaders
Throws:
java.lang.IllegalArgumentException - if a class could not be instantiated

add

void add(java.lang.Class<?> transformerClass)
         throws java.lang.IllegalArgumentException
Adds the transformer specified by the class. Creates an instance immediately and calls the add method. The name of the transformer will be the name of the class trimming "Transformer" and "Transformers" at the end. This can be overruled by using the Transformer annotation. The class must contains at lease one method annotated as Transformer or DefaultTransformer and conform the following rules:

Parameters:
transformerClass - the transformer class
Throws:
java.lang.IllegalArgumentException - if the instance could not be created

add

void add(java.lang.Object transformer)
         throws java.lang.IllegalArgumentException
Adds the specified transformer class. The name of the transformer will be the name of the class trimming "Transformer" and "Transformers" at the end. This can be overruled by using the Transformer annotation. The class must contains at lease one method annotated as Transformer or DefaultTransformer and conform the following rules:

Parameters:
transformer - the transformer class
Throws:
java.lang.IllegalArgumentException - on occasion

getInstance

java.lang.Object getInstance(java.lang.String name)

getMethod

java.lang.reflect.Method getMethod(java.lang.String name,
                                   java.lang.String extension,
                                   int numberOfParameters)


Copyright © 2008. All Rights Reserved.