org.apache.hivemind.annotations.internal
Class AnnotatedModuleProcessor

java.lang.Object
  extended by org.apache.hivemind.annotations.internal.AnnotatedModuleProcessor

public class AnnotatedModuleProcessor
extends java.lang.Object

Does the work for AnnotatedModuleReader. Processes an annotated class and registers the defined extension and extension points in a registry definition. The construction of extension points and extensions bases on reflective method calls to an instance of the module class. The module instance is created by a ModuleInstanceProvider during registry construction.

Author:
Achim Huegen

Constructor Summary
AnnotatedModuleProcessor(org.apache.hivemind.definition.RegistryDefinition registryDefinition, org.apache.hivemind.ClassResolver classResolver, org.apache.hivemind.ErrorHandler errorHandler)
           
 
Method Summary
protected  void checkMethodModifiers(java.lang.reflect.Method method, int allowedModifiers, java.lang.String methodType)
          Ensures that an annotated method has only allowed modifiers.
protected  void checkModuleClassPrerequisites(java.lang.Class moduleClass)
          Ensures that a module class fulfills all prerequisites.
protected  org.apache.hivemind.Location createModuleLocation(java.lang.Class moduleClass)
          Creates a location pointing at the module class.
 void processModule(java.lang.Class moduleClass)
           
 void processModule(java.lang.Class moduleClass, java.lang.String moduleId)
          Processes a module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedModuleProcessor

public AnnotatedModuleProcessor(org.apache.hivemind.definition.RegistryDefinition registryDefinition,
                                org.apache.hivemind.ClassResolver classResolver,
                                org.apache.hivemind.ErrorHandler errorHandler)
Method Detail

processModule

public void processModule(java.lang.Class moduleClass)

processModule

public void processModule(java.lang.Class moduleClass,
                          java.lang.String moduleId)
Processes a module. Inspects the class.

Parameters:
moduleClass -

checkModuleClassPrerequisites

protected void checkModuleClassPrerequisites(java.lang.Class moduleClass)
Ensures that a module class fulfills all prerequisites.

Parameters:
moduleClass -

checkMethodModifiers

protected void checkMethodModifiers(java.lang.reflect.Method method,
                                    int allowedModifiers,
                                    java.lang.String methodType)
Ensures that an annotated method has only allowed modifiers. By default Modifier.PUBLIC and Modifier.PROTECTED are allowed.

Parameters:
method - the method
allowedModifiers - allowed modifiers.
methodType - used in error messages to describe what the method is used for

createModuleLocation

protected org.apache.hivemind.Location createModuleLocation(java.lang.Class moduleClass)
Creates a location pointing at the module class.



Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.