org.objectweb.fractal.adl.components

Class ComponentLoader

Implemented Interfaces:
AttributeController, BindingController, ComponentLoaderAttributes, Loader
Known Direct Subclasses:
ArgumentComponentLoader

public class ComponentLoader
extends AbstractLoader
implements ComponentLoaderAttributes

A Loader to check Component nodes in definitions. This loader checks sub component names, loads the definitons referenced by the component nodes (and the "extends" attribute), and merges all these definitions into a single one (by following inheritance rules).

Field Summary

Fields inherited from class org.objectweb.fractal.adl.AbstractLoader

LOADER_BINDING, clientLoader

Constructor Summary

ComponentLoader()

Method Summary

Component
getComponent(ComponentContainer container, String name)
String
getNameAttributes()
Component
getPathComponent(ComponentContainer container, String name)
Definition
load(List loaded, String name, Map context)
Definition
load(String name, Map context)
Loads the ADL definition whose name is given.
Node
merge(Node elem, Node superElem)
Node
merge(Node elem, Node superElem, Map replacements)
void
normalizeComponentContainer(ComponentContainer container)
ComponentContainer
replaceComponents(ComponentContainer container, Map replacements)
void
resolveComponentContainer(List loaded, ComponentContainer topLevelDefinition, ComponentContainer container, Map context)
Definition
resolveDefinitions(List loaded, String nameList, Map context)
void
setNameAttributes(String nameAttributes)

Methods inherited from class org.objectweb.fractal.adl.AbstractLoader

bindFc, listFc, lookupFc, unbindFc

Constructor Details

ComponentLoader

public ComponentLoader()

Method Details

getComponent

public Component getComponent(ComponentContainer container,
                              String name)


getNameAttributes

public String getNameAttributes()
Specified by:
getNameAttributes in interface ComponentLoaderAttributes


getPathComponent

public Component getPathComponent(ComponentContainer container,
                                  String name)


load

public Definition load(List loaded,
                       String name,
                       Map context)
            throws ADLException


load

public Definition load(String name,
                       Map context)
            throws ADLException
Loads the ADL definition whose name is given.
Specified by:
load in interface Loader

Parameters:
name - the name of an ADL definition.
context - optional additional information.

Returns:
the ADL definition whose name is given.

Throws:
ADLException - if the definition cannot be found, or if it contains errors.


merge

public Node merge(Node elem,
                  Node superElem)
            throws ADLException


merge

public Node merge(Node elem,
                  Node superElem,
                  Map replacements)
            throws ADLException


normalizeComponentContainer

public void normalizeComponentContainer(ComponentContainer container)
            throws ADLException


replaceComponents

public ComponentContainer replaceComponents(ComponentContainer container,
                                            Map replacements)


resolveComponentContainer

public void resolveComponentContainer(List loaded,
                                      ComponentContainer topLevelDefinition,
                                      ComponentContainer container,
                                      Map context)
            throws ADLException


resolveDefinitions

public Definition resolveDefinitions(List loaded,
                                     String nameList,
                                     Map context)
            throws ADLException


setNameAttributes

public void setNameAttributes(String nameAttributes)
Specified by:
setNameAttributes in interface ComponentLoaderAttributes