org.objectweb.fractal.juliak
Class FractalHelper

java.lang.Object
  extended by org.objectweb.fractal.juliak.FractalHelper

public class FractalHelper
extends Object

This class contains helper methods to facilitate the use of the Fractal API.

Since:
2.5
Author:
Lionel Seinturier

Constructor Summary
FractalHelper()
           
 
Method Summary
static void addAllSubComponents(Component c, List l)
          Add all sub-components of the given component to the list.
static void bindFc(BindingController bc, String itfName, Object dstItf)
          Bind the given destination interface to the given client interface name.
static Interface followBindingsUpToLastInterface(Interface start)
          Follow bindings and return the interface associated to the component located at the end of the binding chain.
static Component[] getAllSubComponents(Component c)
          Return all sub-components of the given component.
static AttributeController getAttributeController(Component c)
          Returns the AttributeController interface of the given component.
static BindingController getBindingController(Component c)
          Returns the BindingController interface of the given component.
static Object getContent(Component c)
           
static ContentController getContentController(Component c)
          Returns the ContentController interface of the given component.
static Factory getFactory(Component c)
          Returns the Factory interface of the given component.
static String getFcFullyQualifiedName(Component comp)
          Return the fully-qualified name of a component, i.e. a slash-separated string of names reflecting the hierarchy of nested components.
static Object getFcInterface(Component c, String itfName)
           
static Object getFcInternalInterface(ContentController cc, String itfName)
           
static GenericFactory getGenericFactory(Component c)
          Returns the GenericFactory interface of the given component.
static LifeCycleController getLifeCycleController(Component c)
          Returns the LifeCycleController interface of the given component.
static NameController getNameController(Component c)
          Returns the NameController interface of the given component.
static SuperControllerNotifier getSuperController(Component c)
          Returns the SuperControllerNotifier interface of the given component.
static Component getTopMostComponent(Component c)
          Traverse the super-hierarchy to return the root component.
static TypeFactory getTypeFactory(Component c)
          Returns the TypeFactory interface of the given component.
static boolean isFcControllerInterfaceName(String itfName)
          Return true if the specified name corresponds to the name of a Fractal controller interface.
static boolean isFcControllerMethodName(String methName)
          Return true if the specified name corresponds to the name of a Fractal control method.
static boolean isFcImplementableInterface(String itfName)
          Return true if the specified name corresponds to the name of an interface which should be implemented by a content class.
static Object lookupFc(BindingController bc, String itfName)
           
static String toString(InterfaceType it)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FractalHelper

public FractalHelper()
Method Detail

getFcInterface

public static Object getFcInterface(Component c,
                                    String itfName)

getFcInternalInterface

public static Object getFcInternalInterface(ContentController cc,
                                            String itfName)

getAttributeController

public static AttributeController getAttributeController(Component c)
Returns the AttributeController interface of the given component.

Parameters:
c - a component.
Returns:
the AttributeController interface of the given component.

getBindingController

public static BindingController getBindingController(Component c)
Returns the BindingController interface of the given component.

Parameters:
c - a component.
Returns:
the BindingController interface of the given component.

getContentController

public static ContentController getContentController(Component c)
Returns the ContentController interface of the given component.

Parameters:
c - a component.
Returns:
the ContentController interface of the given component.

getSuperController

public static SuperControllerNotifier getSuperController(Component c)
Returns the SuperControllerNotifier interface of the given component.

Parameters:
c - a component.
Returns:
the SuperControllerNotifier interface of the given component.

getNameController

public static NameController getNameController(Component c)
Returns the NameController interface of the given component.

Parameters:
c - a component.
Returns:
the NameController interface of the given component.

getLifeCycleController

public static LifeCycleController getLifeCycleController(Component c)
Returns the LifeCycleController interface of the given component.

Parameters:
c - a component.
Returns:
the LifeCycleController interface of the given component.
Throws:
NoSuchInterfaceException - if there is no such interface.

getFactory

public static Factory getFactory(Component c)
Returns the Factory interface of the given component.

Parameters:
c - a component.
Returns:
the Factory interface of the given component.

getGenericFactory

public static GenericFactory getGenericFactory(Component c)
Returns the GenericFactory interface of the given component.

Parameters:
c - a component.
Returns:
the GenericFactory interface of the given component.

getTypeFactory

public static TypeFactory getTypeFactory(Component c)
Returns the TypeFactory interface of the given component.

Parameters:
c - a component.
Returns:
the TypeFactory interface of the given component.

bindFc

public static void bindFc(BindingController bc,
                          String itfName,
                          Object dstItf)
Bind the given destination interface to the given client interface name.

Parameters:
bc - the binding controller
itfName - the client interface name
dstItf - the destination interface

lookupFc

public static Object lookupFc(BindingController bc,
                              String itfName)

getAllSubComponents

public static Component[] getAllSubComponents(Component c)
Return all sub-components of the given component.


addAllSubComponents

public static void addAllSubComponents(Component c,
                                       List l)
Add all sub-components of the given component to the list.


followBindingsUpToLastInterface

public static Interface followBindingsUpToLastInterface(Interface start)
Follow bindings and return the interface associated to the component located at the end of the binding chain.


getContent

public static Object getContent(Component c)

isFcControllerInterfaceName

public static boolean isFcControllerInterfaceName(String itfName)
Return true if the specified name corresponds to the name of a Fractal controller interface. Note: factory is not considered as a controller interface but as a business one.


isFcControllerMethodName

public static boolean isFcControllerMethodName(String methName)
Return true if the specified name corresponds to the name of a Fractal control method.


isFcImplementableInterface

public static boolean isFcImplementableInterface(String itfName)
Return true if the specified name corresponds to the name of an interface which should be implemented by a content class.


getFcFullyQualifiedName

public static String getFcFullyQualifiedName(Component comp)
Return the fully-qualified name of a component, i.e. a slash-separated string of names reflecting the hierarchy of nested components.


getTopMostComponent

public static Component getTopMostComponent(Component c)
Traverse the super-hierarchy to return the root component.


toString

public static String toString(InterfaceType it)