edu.memphis.ccrg.lida.framework.initialization
Class FactoriesDataXmlLoader

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.initialization.FactoriesDataXmlLoader

public class FactoriesDataXmlLoader
extends java.lang.Object

Loads the factoriesData.xml file which configures the factories of the framework i.e. what strategies are used by the objects created by the factory, the types of node, links, and FrameworkTask that can be created as well.

Author:
Javier Snaider

Constructor Summary
FactoriesDataXmlLoader()
           
 
Method Summary
(package private) static void checkStrategies(java.util.List<java.lang.String> strat, java.util.Map<java.lang.String,StrategyDef> strategies)
          Verifies if the List of Strategies names are defined
(package private) static java.util.Map<ModuleName,java.lang.String> getAssociatedModules(org.w3c.dom.Element element)
          reads the associated modules of this element
(package private) static LinkableDef getLinkable(org.w3c.dom.Element e, java.util.Map<java.lang.String,StrategyDef> strategies)
           
(package private) static java.util.Map<java.lang.String,LinkableDef> getLinkables(org.w3c.dom.Element element, java.lang.String groupName, java.lang.String childName, java.util.Map<java.lang.String,StrategyDef> strategies)
          Reads in and creates all LinkableDefs specified in Element
(package private) static java.util.Map<java.lang.String,StrategyDef> getStrategies(org.w3c.dom.Element element)
          Reads in and creates all StrategyDefs specified in Element
(package private) static StrategyDef getStrategyDef(org.w3c.dom.Element e)
           
(package private) static FrameworkTaskDef getTaskDef(org.w3c.dom.Element e, java.util.Map<java.lang.String,StrategyDef> strategies)
           
(package private) static java.util.Map<java.lang.String,FrameworkTaskDef> getTasks(org.w3c.dom.Element element, java.util.Map<java.lang.String,StrategyDef> strategies)
          Reads in and creates all FrameworkTaskDefs specified in Element
static void loadFactoriesData(java.util.Properties properties)
          Loads ElementFactory with object types specified in Properties
(package private) static void parseDocument(org.w3c.dom.Document dom)
          Parses the xml document creating the elements for ElementFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoriesDataXmlLoader

public FactoriesDataXmlLoader()
Method Detail

loadFactoriesData

public static void loadFactoriesData(java.util.Properties properties)
Loads ElementFactory with object types specified in Properties

Parameters:
properties - Properties

parseDocument

static void parseDocument(org.w3c.dom.Document dom)
Parses the xml document creating the elements for ElementFactory

Parameters:
dom - the xml dom Document

getStrategies

static java.util.Map<java.lang.String,StrategyDef> getStrategies(org.w3c.dom.Element element)
Reads in and creates all StrategyDefs specified in Element

Parameters:
element - Dom element
Returns:
a Map with the StrategyDef indexed by name

getStrategyDef

static StrategyDef getStrategyDef(org.w3c.dom.Element e)
Parameters:
e - Dom element
Returns:
the Strategy definition

getLinkables

static java.util.Map<java.lang.String,LinkableDef> getLinkables(org.w3c.dom.Element element,
                                                                java.lang.String groupName,
                                                                java.lang.String childName,
                                                                java.util.Map<java.lang.String,StrategyDef> strategies)
Reads in and creates all LinkableDefs specified in Element

Parameters:
element - Dom element
groupName - the name of the group containing LinkableDef data
childName - the name of the children containing LinkableDef data
strategies - Map with StrategyDef indexed by name
Returns:
a Map of LinkableDef indexed by name

getLinkable

static LinkableDef getLinkable(org.w3c.dom.Element e,
                               java.util.Map<java.lang.String,StrategyDef> strategies)
Parameters:
e - Dom element
strategies - Map with StrategyDef indexed by name
Returns:
the Linkable definition

getTasks

static java.util.Map<java.lang.String,FrameworkTaskDef> getTasks(org.w3c.dom.Element element,
                                                                 java.util.Map<java.lang.String,StrategyDef> strategies)
Reads in and creates all FrameworkTaskDefs specified in Element

Parameters:
element - Dom element
strategies - Map with StrategyDef indexed by name
Returns:
a Map of FrameworkTaskDef indexed by name

getAssociatedModules

static java.util.Map<ModuleName,java.lang.String> getAssociatedModules(org.w3c.dom.Element element)
reads the associated modules of this element

Parameters:
element - Dom element
Returns:
a Map with the associated modules

getTaskDef

static FrameworkTaskDef getTaskDef(org.w3c.dom.Element e,
                                   java.util.Map<java.lang.String,StrategyDef> strategies)
Parameters:
e - Dom element
strategies - Map with StrategyDef indexed by name
Returns:
the FrameworkTaskDef definition

checkStrategies

static void checkStrategies(java.util.List<java.lang.String> strat,
                            java.util.Map<java.lang.String,StrategyDef> strategies)
Verifies if the List of Strategies names are defined

Parameters:
strat - Strategies names to validate
strategies - Map with StrategyDef indexed by name