org.apache.beehive.controls.runtime.assembly
Class BaseAssemblyContext

Object
  extended by BaseAssemblyContext
All Implemented Interfaces:
ControlAssemblyContext
Direct Known Subclasses:
AppAssemblyContext, EJBAssemblyContext, WebAppAssemblyContext

public abstract class BaseAssemblyContext
extends Object
implements ControlAssemblyContext

Abstract ControlAssemblyContext implementation. Provides a basic implementation of most non-module-specific APIs, meant to be extended by module-specific types.


Nested Class Summary
 
Nested classes/interfaces inherited from interface ControlAssemblyContext
ControlAssemblyContext.EJBModule, ControlAssemblyContext.EntAppModule, ControlAssemblyContext.Factory, ControlAssemblyContext.WebAppModule
 
Constructor Summary
protected BaseAssemblyContext(Class controlIntfOrExt, Map<String,String> bindings, Set<String> clients, File moduleRoot, String moduleName, File srcOutputRoot)
           
 
Method Summary
 Set<String> getClients()
           
<T extends Annotation>
T
getControlAnnotation(Class<T> annotationClass)
           
<T extends Annotation>
T
getControlMethodAnnotation(Class<T> annotationClass, Method m)
           
 Class getControlType()
           
 String getDefaultImplClassName()
           
 Messager getMessager()
           
 File getModuleDir()
           
 String getModuleName()
           
 Class getMostDerivedControlInterface()
           
 File getSrcOutputDir()
           
 boolean hasErrors()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseAssemblyContext

protected BaseAssemblyContext(Class controlIntfOrExt,
                              Map<String,String> bindings,
                              Set<String> clients,
                              File moduleRoot,
                              String moduleName,
                              File srcOutputRoot)
                       throws ControlAssemblyException
Throws:
ControlAssemblyException
Method Detail

getControlType

public Class getControlType()
Specified by:
getControlType in interface ControlAssemblyContext
Returns:
the interface type of the control being assembled (annotated w/ ControlExtension or ControlInterface)

getMostDerivedControlInterface

public Class getMostDerivedControlInterface()
Specified by:
getMostDerivedControlInterface in interface ControlAssemblyContext
Returns:
the most derived interface of the control being assembled that is annotated with ControlInterface (may return the same as getControlType() if the control type is non-extended)

getControlAnnotation

public <T extends Annotation> T getControlAnnotation(Class<T> annotationClass)
Specified by:
getControlAnnotation in interface ControlAssemblyContext
Returns:
an annotation on the interface returned by getControlType()

getControlMethodAnnotation

public <T extends Annotation> T getControlMethodAnnotation(Class<T> annotationClass,
                                                           Method m)
                                                throws NoSuchMethodException
Specified by:
getControlMethodAnnotation in interface ControlAssemblyContext
Returns:
an annotation on a method on the interface returned by getControlType()
Throws:
NoSuchMethodException

getDefaultImplClassName

public String getDefaultImplClassName()
Specified by:
getDefaultImplClassName in interface ControlAssemblyContext
Returns:
the defaultBinding member of the ControlInterface

getSrcOutputDir

public File getSrcOutputDir()
Specified by:
getSrcOutputDir in interface ControlAssemblyContext
Returns:
the output directory into which "compilable" source should be output.

getModuleDir

public File getModuleDir()
Specified by:
getModuleDir in interface ControlAssemblyContext
Returns:
the root of the module for which assembly is taking place.

getModuleName

public String getModuleName()
Specified by:
getModuleName in interface ControlAssemblyContext
Returns:
the name of the module for which assembly is taking place.

getClients

public Set<String> getClients()
Specified by:
getClients in interface ControlAssemblyContext
Returns:
the set of clients (by class name) which use the control type

getMessager

public Messager getMessager()
Specified by:
getMessager in interface ControlAssemblyContext
Returns:
a Messager implementation that can be used to emit diagnostics during the assembly process.

hasErrors

public boolean hasErrors()
Specified by:
hasErrors in interface ControlAssemblyContext
Returns:
true if the assembly process reported errors via the Messager