org.jboss.metadata.annotation.creator
Class AbstractCreator<MD>

java.lang.Object
  extended by org.jboss.metadata.annotation.creator.AbstractFinderUser
      extended by org.jboss.metadata.annotation.creator.AbstractCreator<MD>
Direct Known Subclasses:
ApplicationClient5MetaDataCreator, EjbJar30Creator, JBoss50Creator, Web25MetaDataCreator

public abstract class AbstractCreator<MD>
extends AbstractFinderUser

A abstract base creator.

Version:
$Revision$
Author:
Emanuel Muckenhuber

Field Summary
 
Fields inherited from class org.jboss.metadata.annotation.creator.AbstractFinderUser
finder
 
Constructor Summary
protected AbstractCreator(AnnotationFinder<AnnotatedElement> finder)
          The constructor.
 
Method Summary
 void addProcessor(Processor<MD,Class<?>> processor)
          Add a Class processor.
abstract  MD create(Collection<Class<?>> classes)
          Abstract create method of a Creator, MD>.
 AnnotationContext getAnnotationContext()
          Create a basic annotation context, based on the information of the added processors.
protected  Collection<Class<? extends Annotation>> getAnnotationsForScope(AbstractProcessor.Scope scope)
          Get annotations for a given Scope.
protected  void process(MD metaData, Class<?> type)
          Process the meta data.
protected
<T extends MD>
void
processMetaData(Collection<Class<?>> classes, T metaData)
          Process the meta data.
protected abstract  boolean validateClass(Class<?> clazz)
          Check a class if it needs to be processed.
protected  Collection<Class<?>> validateClasses(Collection<Class<?>> classes)
          Check a set of classes if further processing is needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCreator

protected AbstractCreator(AnnotationFinder<AnnotatedElement> finder)
The constructor.

Parameters:
finder - the AnnotationFinder
Method Detail

create

public abstract MD create(Collection<Class<?>> classes)
Abstract create method of a Creator, MD>.

Parameters:
element - the classes
Returns:
the metadata

processMetaData

protected <T extends MD> void processMetaData(Collection<Class<?>> classes,
                                              T metaData)
Process the meta data.

Parameters:
classes - the classes
metaData - the meta data

validateClass

protected abstract boolean validateClass(Class<?> clazz)
Check a class if it needs to be processed.

Parameters:
clazz - the Class
Returns:
if it needs to be further processed

validateClasses

protected Collection<Class<?>> validateClasses(Collection<Class<?>> classes)
Check a set of classes if further processing is needed.

Parameters:
classes - the classes
Returns:
a collection of checked classes

addProcessor

public void addProcessor(Processor<MD,Class<?>> processor)
Add a Class processor.

Parameters:
processor -
Throws:
IllegalArgumentException

process

protected void process(MD metaData,
                       Class<?> type)
Process the meta data.

Parameters:
metaData - the meta data
type - a Class
Throws:
IllegalArgumentException

getAnnotationsForScope

protected Collection<Class<? extends Annotation>> getAnnotationsForScope(AbstractProcessor.Scope scope)
Get annotations for a given Scope.

Parameters:
scope - the Scope
Returns:
the processed annotations

getAnnotationContext

public AnnotationContext getAnnotationContext()
Create a basic annotation context, based on the information of the added processors.

Returns:
the annotation context


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.