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

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

public abstract class BaseAssemblyContext
extends Object
implements ControlAssemblyContext

Base ControlAssemblyContext implementation


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, File moduleRoot, File srcOutputRoot)
           
 
Method Summary
 File createJavaOutputFile(String packageName, String className)
           
<T extends Annotation>
T
getControlAnnotation(Class<T> annotationClass)
           
<T extends Annotation>
T
getControlMethodAnnotation(Class<T> annotationClass, Method m)
           
 Class getControlType()
           
 String getDefaultImplClassName()
           
 File getModuleDir()
           
 Class getMostDerivedControlInterface()
           
 
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,
                              File moduleRoot,
                              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

createJavaOutputFile

public File createJavaOutputFile(String packageName,
                                 String className)
Specified by:
createJavaOutputFile in interface ControlAssemblyContext
Returns:
a File into which Java source can be written. Results in a file called .java (in the directory given by ).

getModuleDir

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