|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.config.xml.Factories
public class Factories
General class used to create a configuration object representing parsed XML file.
This class is inherited by all factories for specific components - AssemblyLineFactory, FunctionFactory, HookFactory etc.
Field Summary | |
---|---|
static Hashtable<String,Factories> |
classMap
Tags / class mapping |
static Hashtable<String,String> |
implMap
Hashtable containig the mapping between the XML tag names and the corresponding factory classes. |
static String |
INHERIT_TAG
General tag - "InheritFrom" |
static Log |
logger
Logger |
static String |
NAME_ATTRIBUTE
General attribute - "name" |
static String |
NAME_TAG
General tag - "Name" |
static String |
NULLBEHAVIOR
General attribute - "NullBehavior" |
static String |
NULLBEHAVIORVALUE
General attribute - "NullBehaviorValue" |
static String |
NULLDEFINITION
General attribute - "NullDefinition" |
static String |
NULLDEFINITIONVALUE
General attribute - "NullDefinitionValue" |
static String |
PARAMETER_TAG
General tag - "parameter" |
Factories |
parent
Parent of this factory. |
static String |
USER_COMMENT_ATTRIBUTE
General attribute - "UserComment" |
static String |
VALUE_ATTRIBUTE
General attribute - "value" |
Constructor Summary | |
---|---|
Factories()
|
Method Summary | |
---|---|
void |
build(BaseConfiguration config,
Element element)
Generate a XML element from a configuration object. |
static void |
debug(String msg)
Prints debug message. |
static void |
dump(BaseConfiguration config)
List information for this factory. |
void |
getBaseName(BaseConfiguration config,
Element elem)
This method retries the name and inheritFrom attributes/elements and configures the base object with its name and also calls MetamergeConfig for any inherited objects. |
static String |
getClassTag(Object config)
|
static Factories |
getFactory(String tag)
|
static BaseConfiguration |
getImpl(String tag)
|
void |
getInheritsFrom(BaseConfiguration config,
Element elem)
This method retries the inheritsFrom element and configures the base object with the retrieved information. |
String |
getNodeText(Node node)
|
String |
getNodeTextByName(Element node,
String name)
|
void |
getParameter(Element p,
BaseConfiguration config)
Add simple parameter to configuration. |
void |
getParameters(Element p,
BaseConfiguration config)
Add simple parameters to configuration. |
Element |
getSingleElement(Element node,
String name)
|
static boolean |
isDebugMode()
|
static void |
logmsg(String msg)
Logs message. |
void |
parse(BaseConfiguration config,
Element element)
Parse a XML element into a configuration object. |
void |
setBaseName(BaseConfiguration config,
Element elem)
Attaches to the XML tree a single element representing the user comment. |
void |
setInheritsFrom(BaseConfiguration config,
Element elem)
Set the inheritFrom if it exists. |
void |
setParameter(Element p,
BaseConfiguration config,
Object pname)
Generates XML element for parameter, initialize it and attach it to the p object. |
Element |
setParameters(Element p,
BaseConfiguration config,
String tag)
|
void |
setSingleElement(Element node,
String tag,
BaseConfiguration bc,
String name)
Sets a simple tag/value. |
void |
setSingleElement(Element node,
String tag,
String value)
Sets a simple tag/value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Log logger
public static final Hashtable<String,Factories> classMap
public static final Hashtable<String,String> implMap
public static final String PARAMETER_TAG
public static final String NAME_TAG
public static final String INHERIT_TAG
public static final String NAME_ATTRIBUTE
public static final String VALUE_ATTRIBUTE
public static final String USER_COMMENT_ATTRIBUTE
public static final String NULLBEHAVIOR
public static final String NULLBEHAVIORVALUE
public static final String NULLDEFINITION
public static final String NULLDEFINITIONVALUE
public Factories parent
Constructor Detail |
---|
public Factories()
Method Detail |
---|
public static Factories getFactory(String tag) throws Exception
tag
- XML tag name
Exception
- no mapping for such XML tag existpublic static BaseConfiguration getImpl(String tag) throws Exception
tag
- XML tag name
Exception
- no mapping for such XML tag existpublic static String getClassTag(Object config)
config
- Factory object
public static boolean isDebugMode()
public void parse(BaseConfiguration config, Element element) throws Exception
config
- an instance of the BaseConfiguration
class which
internal parameters will get set based on the information from
the provided XML Element.element
- this is a part of the XML tree that represents the
BaseConfiguration
object.
Exception
- in case the configuration object the provided XML element
represents is not recognized.public void build(BaseConfiguration config, Element element) throws Exception
config
- an instance of the BaseConfiguration
class which
internal parameters will be represented as a XML sub-tree.element
- this is the part of the XML tree where the config object's XML
representation will be attached to.
Exception
- in case the tag name of the provided XML element is not
recognized as a valid name which is used for configuration
object representation as a XML.public static void debug(String msg)
msg
- text of the messagepublic static void logmsg(String msg)
msg
- text of the message.public static void dump(BaseConfiguration config)
config
- configuration objectpublic void getBaseName(BaseConfiguration config, Element elem) throws Exception
config
- an instance of the BaseConfiguration
class which
internal parameters will get set based on the information from
the provided XML Element.elem
- this is a part of the XML tree that represents the
BaseConfiguration
object.
Exception
- if could not return text from node's childrenpublic void getInheritsFrom(BaseConfiguration config, Element elem) throws Exception
config
- an instance of the BaseConfiguration
class which
internal parameters will get set based on the information from
the provided XML Element.elem
- this is a part of the XML tree that represents the
BaseConfiguration
object.
Exception
- if could not return text from node's childrenpublic void setBaseName(BaseConfiguration config, Element elem) throws Exception
config
- an instance of the BaseConfiguration
class which
internal parameters will get set based on the information from
the provided XML Element.elem
- this is the part of the XML tree where the config object's XML
representation will be attached to.
Exception
- if could not return text from node's childrenpublic void setInheritsFrom(BaseConfiguration config, Element elem) throws Exception
config
- an instance of the BaseConfiguration
class which
internal parameters will get set based on the information from
the provided XML Element.elem
- this is the part of the XML tree where the config object's XML
representation will be attached to.
Exception
public void getParameters(Element p, BaseConfiguration config) throws Exception
p
- this is a part of the XML tree that represents the
BaseConfiguration
object.config
- an instance of the BaseConfiguration
class
Exception
public void getParameter(Element p, BaseConfiguration config) throws Exception
p
- this is a part of the XML tree that represents the
BaseConfiguration
object.config
- an instance of the BaseConfiguration
class
Exception
public Element setParameters(Element p, BaseConfiguration config, String tag) throws Exception
config
- an instance of the BaseConfiguration
class which
internal parameters will get set based on the information from
the provided XML Element.p
- this is the part of the XML tree where the config object's XML
representation will be attached to.tag
- XML tag name to be created
Exception
public void setParameter(Element p, BaseConfiguration config, Object pname) throws Exception
p
object.
config
- an instance of the BaseConfiguration
class which
internal parameters will get set based on the information from
the provided XML Element.p
- this is the part of the XML tree where the config object's XML
representation will be attached to.pname
-
Exception
public String getNodeText(Node node) throws Exception
node
- Node object
Exception
public Element getSingleElement(Element node, String name) throws Exception
node
- Node objectname
- name to locate
Exception
public String getNodeTextByName(Element node, String name) throws Exception
node
- Node objectname
- child name
Exception
public void setSingleElement(Element node, String tag, BaseConfiguration bc, String name) throws Exception
node
- Node objecttag
- XML tag namebc
- BaseConfiguration objectname
- name of the single Element
Exception
public void setSingleElement(Element node, String tag, String value) throws Exception
node
- Node objecttag
- XML tag namevalue
- text node value
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |