org.objectweb.fractal.explorer
Class FcExplorer

java.lang.Object
  extended by org.objectweb.fractal.explorer.FcExplorer

public class FcExplorer
extends Object

Utilities class for Fractal.

Version:
0.1
Author:
Philippe Merle, Jérôme Moroy

Constructor Summary
FcExplorer()
           
 
Method Summary
static ImageIcon createIcon(String imageName)
          Returns an ImageIcon, or null if the path is invalid.
static AttributeController getAttributeController(Component component)
          Returns the AttributeController interface of the given component.
static BindingController getBindingController(Component component)
          Returns the BindingController interface of the given component.
static Component getBootstrapComponent()
          Returns a bootstrap component to create other components.
static Component getComponent(Object obj)
          Provides the reference to the component associated to this object.
static ContentController getContentController(Component component)
          Returns the ContentController interface of the given component.
static Factory getFactory(Component component)
          Returns the Factory interface of the given component.
static GenericFactory getGenericFactory(Component component)
          Returns the GenericFactory interface of the given component.
static LifeCycleController getLifeCycleController(Component component)
          Returns the LifeCycleController interface of the given component.
static String getLifeCycleState(Interface itf)
          Provides the value of the life cycle state associated to the interface.
static String getName(Component cpt)
          Provides the name of a component.
static String getName(Interface itf)
          Provides the name of an interface.
static String getName(InterfaceType itf)
           
static String getName(Object obj)
          Provides the name of an object.
static NameController getNameController(Component component)
          Returns the NameController interface of the given component.
static String getPrefixedName(Object obj)
          Provides the name of the object prefixed by the component name.
static Component getPrimitiveCpt(Interface itf)
          Provides the primitive component that own the interface itf.
static Interface getPrimitiveItf(Interface itf)
          Provides the interface of the primitive component to which the itt is binded.
static SuperController getSuperController(Component component)
          Returns the SuperController interface of the given component.
static TypeFactory getTypeFactory(Component component)
          Returns the TypeFactory interface of the given component.
static boolean isClient(Interface ir)
          Return true if the given Interface is a Client interface.
static boolean isClientCollection(Interface ir)
          Return true if the given Interface is a Collection Client interface.
static boolean isClientCollection(InterfaceType it)
          Return true if the given InterfaceType is a Collection Client interface.
static boolean isCollection(Interface itf)
          Return true if the given Interface is a Collection interface.
static boolean isController(Interface itf)
          Return true if the given Interface is a Control interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FcExplorer

public FcExplorer()
Method Detail

getPrimitiveItf

public static Interface getPrimitiveItf(Interface itf)
Provides the interface of the primitive component to which the itt is binded.

Parameters:
itf - the indirect interface.
Returns:
the primitive interface.

getPrimitiveCpt

public static Component getPrimitiveCpt(Interface itf)
Provides the primitive component that own the interface itf.

Parameters:
itf - the indirect interface.
Returns:
the primitive component.

getLifeCycleState

public static String getLifeCycleState(Interface itf)
Provides the value of the life cycle state associated to the interface.

Parameters:
itf - the interface to introspect.
Returns:
the state of the interface ("STARTED" if started, "STOPPED" else).

getComponent

public static Component getComponent(Object obj)
Provides the reference to the component associated to this object.

Parameters:
obj - the base object reference.
Returns:
the associated component.

getPrefixedName

public static String getPrefixedName(Object obj)
Provides the name of the object prefixed by the component name.

Parameters:
obj - the object to identify.
Returns:
the associated name.

getName

public static String getName(Object obj)
Provides the name of an object.

Parameters:
obj - the object to identify.
Returns:
the associated name ('unknown' if no name).

getName

public static String getName(InterfaceType itf)
Parameters:
itf - the interface to introspect.
Returns:
the name of the interface.

getName

public static String getName(Interface itf)
Provides the name of an interface.

Parameters:
itf - the interface to identify.
Returns:
the name of the interface.

getName

public static String getName(Component cpt)
Provides the name of a component.

Parameters:
cpt - the component to identify.
Returns:
the name of the component (the name of the associated interface if no NameController).

getBootstrapComponent

public static Component getBootstrapComponent()
                                       throws InstantiationException
Returns a bootstrap component to create other components. This method just calls the corresponding method of the org.objectweb.fractal.api.Fractal class.

Returns:
a bootstrap component to create other components.
Throws:
InstantiationException - if the bootstrap component cannot be created.

getAttributeController

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

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

getBindingController

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

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

getContentController

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

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

getSuperController

public static SuperController getSuperController(Component component)
                                          throws NoSuchInterfaceException
Returns the SuperController interface of the given component.

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

getNameController

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

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

getLifeCycleController

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

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

getFactory

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

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

getGenericFactory

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

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

getTypeFactory

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

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

isClient

public static boolean isClient(Interface ir)
Return true if the given Interface is a Client interface.

Parameters:
ir - the interface.
Returns:
true if interface is client type.

isCollection

public static boolean isCollection(Interface itf)
Return true if the given Interface is a Collection interface.

Parameters:
itf - the interface to check.
Returns:
true if interface is collection type.

isClientCollection

public static boolean isClientCollection(InterfaceType it)
Return true if the given InterfaceType is a Collection Client interface.

Parameters:
it -
Returns:
true if the interface is client and collection.

isClientCollection

public static boolean isClientCollection(Interface ir)
Return true if the given Interface is a Collection Client interface.

Parameters:
ir -
Returns:
true if the interface is client and collection.

isController

public static boolean isController(Interface itf)
Return true if the given Interface is a Control interface.

Parameters:
itf -
Returns:
true if the name of the given interface ends with -controller or if it is equal to factory or if it is equal to component

createIcon

public static ImageIcon createIcon(String imageName)
Returns an ImageIcon, or null if the path is invalid.

Parameters:
imageName - the icon name.
Returns:
the image icon.