org.objectweb.fractal.adl
Interface Parser

All Known Implementing Classes:
BasicParser

public interface Parser

A component interface to load template components.


Method Summary
 Component loadTemplate(String name, boolean template)
          Loads the template component whose name is given.
 ComponentType loadType(String name)
          Loads the component type whose name is given.
 void registerExternalComponent(String name, Component component)
          Registers an external component under the given name.
 

Method Detail

loadType

public ComponentType loadType(String name)
                       throws ParserException
Loads the component type whose name is given. Depending on the implementation, this method can return or not a different object when it is called several times with the same argument.

Parameters:
name - a component type name.
Returns:
the component type object whose name is given.
Throws:
ParserException - if the component type definition cannot be loaded, if it is invalid, or if the corresponding component type object cannot be created.

loadTemplate

public Component loadTemplate(String name,
                              boolean template)
                       throws ParserException
Loads the template component whose name is given. Depending on the implementation, this method can return or not a different component when it is called several times with the same argument.

Parameters:
name - a template name.
template - true to return a template component, false to return directly the instantiated component.
Returns:
the Component interface of the loaded template component.
Throws:
ParserException - if the template definition cannot be loaded, if it is invalid, or if the corresponding template component cannot be created.

registerExternalComponent

public void registerExternalComponent(String name,
                                      Component component)
Registers an external component under the given name. External components are used to create the template components corresponding to <external-template> template descriptors.

Parameters:
name - the name of the external component.
component - an already instantiated component.