org.objectweb.fractal.julia.factory
Class BasicGenericFactoryMixin

java.lang.Object
  extended byorg.objectweb.fractal.julia.factory.BasicGenericFactoryMixin
All Implemented Interfaces:
GenericFactory

public class BasicGenericFactoryMixin
extends Object
implements GenericFactory

Provides a basic implementation of the GenericFactory interface.

Requirements


Field Summary
 Loader _this_weaveableL
          The weaveableL field required by this mixin.
 TypeFactory _this_weaveableTF
          The weaveableTF field required by this mixin.
 
Constructor Summary
BasicGenericFactoryMixin()
           
 
Method Summary
 Tree getFcContentDescriptor(Object contentDesc)
          Returns the tree corresponding to the given content descriptor.
 Tree getFcControllerDescriptor(Object controllerDesc)
          Returns the tree corresponding to the given controller descriptor.
 Tree getFcTypeDescriptor(Type type)
          Returns a tree representing the given component type.
 Component newFcInstance(Type type, Object controllerDesc, Object contentDesc)
          Creates a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_this_weaveableL

public Loader _this_weaveableL
The weaveableL field required by this mixin. This field is supposed to reference the Loader interface of the component to which this controller object belongs.


_this_weaveableTF

public TypeFactory _this_weaveableTF
The weaveableTF field required by this mixin. This field is supposed to reference the TypeFactory interface of the component to which this controller object belongs.

Constructor Detail

BasicGenericFactoryMixin

public BasicGenericFactoryMixin()
Method Detail

newFcInstance

public Component newFcInstance(Type type,
                               Object controllerDesc,
                               Object contentDesc)
                        throws InstantiationException
Description copied from interface: GenericFactory
Creates a component.

Specified by:
newFcInstance in interface GenericFactory
Parameters:
type - an arbitrary component type.
controllerDesc - a description of the controller part of the component to be created. This description is implementation specific. If it is null then a "default" controller part will be used.
contentDesc - a description of the content part of the component to be created. This description is implementation specific. It may be null to create component with an empty initial content. It may also be, in Java, the fully qualified name of a Java class, to create primitive components.
Returns:
the Component interface of the created component.
Throws:
InstantiationException - if the component cannot be created.

getFcTypeDescriptor

public Tree getFcTypeDescriptor(Type type)
                         throws InstantiationException
Returns a tree representing the given component type. This tree has the format specified in ContextClassGenerator

Parameters:
type - a component type, must be instance of ComponentType.
Returns:
a tree representing the given component type.
Throws:
InstantiationException - if the given type is not an instance of ComponentType, or if it contains control interface types.

getFcControllerDescriptor

public Tree getFcControllerDescriptor(Object controllerDesc)
                               throws InstantiationException
Returns the tree corresponding to the given controller descriptor. This tree is found by using the _this_weaveableL loader. It must have the format specified in ContextClassGenerator

Parameters:
controllerDesc - a string referencing a true controller descriptor.
Returns:
the tree corresponding to the given controller descriptor.
Throws:
InstantiationException - if the tree cannot be loaded.

getFcContentDescriptor

public Tree getFcContentDescriptor(Object contentDesc)
Returns the tree corresponding to the given content descriptor. This tree has the format specified in ContextClassGenerator

Returns:
the tree corresponding to the given content descriptor.