|
||||||||||
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 java.util.Hashtable<java.lang.String,Factories> |
classMap
Tags / class mapping |
static java.util.Hashtable<java.lang.String,java.lang.String> |
implMap
Hashtable containig the mapping between the XML tag names and the corresponding factory classes. |
static java.lang.String |
INHERIT_TAG
General tag - "InheritFrom" |
static Log |
logger
Logger |
static java.lang.String |
NAME_ATTRIBUTE
General attribute - "name" |
static java.lang.String |
NAME_TAG
General tag - "Name" |
static java.lang.String |
NULLBEHAVIOR
General attribute - "NullBehavior" |
static java.lang.String |
NULLBEHAVIORVALUE
General attribute - "NullBehaviorValue" |
static java.lang.String |
NULLDEFINITION
General attribute - "NullDefinition" |
static java.lang.String |
NULLDEFINITIONVALUE
General attribute - "NullDefinitionValue" |
static java.lang.String |
PARAMETER_TAG
General tag - "parameter" |
Factories |
parent
Parent of this factory. |
static java.lang.String |
USER_COMMENT_ATTRIBUTE
General attribute - "UserComment" |
static java.lang.String |
VALUE_ATTRIBUTE
General attribute - "value" |
Constructor Summary | |
---|---|
Factories()
|
Method Summary | |
---|---|
void |
build(BaseConfiguration config,
org.w3c.dom.Element element)
Generate a XML element from a configuration object. |
static void |
debug(java.lang.String msg)
Prints debug message. |
static void |
dump(BaseConfiguration config)
List information for this factory. |
void |
getBaseName(BaseConfiguration config,
org.w3c.dom.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 java.lang.String |
getClassTag(java.lang.Object config)
|
static Factories |
getFactory(java.lang.String tag)
|
static BaseConfiguration |
getImpl(java.lang.String tag)
|
void |
getInheritsFrom(BaseConfiguration config,
org.w3c.dom.Element elem)
This method retries the inheritsFrom element and configures the base object with the retrieved information. |
java.lang.String |
getNodeText(org.w3c.dom.Node node)
|
java.lang.String |
getNodeTextByName(org.w3c.dom.Element node,
java.lang.String name)
|
void |
getParameter(org.w3c.dom.Element p,
BaseConfiguration config)
Add simple parameter to configuration. |
void |
getParameters(org.w3c.dom.Element p,
BaseConfiguration config)
Add simple parameters to configuration. |
org.w3c.dom.Element |
getSingleElement(org.w3c.dom.Element node,
java.lang.String name)
|
static boolean |
isDebugMode()
|
static void |
logmsg(java.lang.String msg)
Logs message. |
void |
parse(BaseConfiguration config,
org.w3c.dom.Element element)
Parse a XML element into a configuration object. |
void |
setBaseName(BaseConfiguration config,
org.w3c.dom.Element elem)
Attaches to the XML tree a single element representing the user comment. |
void |
setInheritsFrom(BaseConfiguration config,
org.w3c.dom.Element elem)
Set the inheritFrom if it exists. |
void |
setParameter(org.w3c.dom.Element p,
BaseConfiguration config,
java.lang.Object pname)
Generates XML element for parameter, initialize it and attach it to the p object. |
org.w3c.dom.Element |
setParameters(org.w3c.dom.Element p,
BaseConfiguration config,
java.lang.String tag)
|
void |
setSingleElement(org.w3c.dom.Element node,
java.lang.String tag,
BaseConfiguration bc,
java.lang.String name)
Sets a simple tag/value. |
void |
setSingleElement(org.w3c.dom.Element node,
java.lang.String tag,
java.lang.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 java.util.Hashtable<java.lang.String,Factories> classMap
public static final java.util.Hashtable<java.lang.String,java.lang.String> implMap
public static final java.lang.String PARAMETER_TAG
public static final java.lang.String NAME_TAG
public static final java.lang.String INHERIT_TAG
public static final java.lang.String NAME_ATTRIBUTE
public static final java.lang.String VALUE_ATTRIBUTE
public static final java.lang.String USER_COMMENT_ATTRIBUTE
public static final java.lang.String NULLBEHAVIOR
public static final java.lang.String NULLBEHAVIORVALUE
public static final java.lang.String NULLDEFINITION
public static final java.lang.String NULLDEFINITIONVALUE
public Factories parent
Constructor Detail |
---|
public Factories()
Method Detail |
---|
public static Factories getFactory(java.lang.String tag) throws java.lang.Exception
tag
- XML tag name
java.lang.Exception
- no mapping for such XML tag existpublic static BaseConfiguration getImpl(java.lang.String tag) throws java.lang.Exception
tag
- XML tag name
java.lang.Exception
- no mapping for such XML tag existpublic static java.lang.String getClassTag(java.lang.Object config)
config
- Factory object
public static boolean isDebugMode()
public void parse(BaseConfiguration config, org.w3c.dom.Element element) throws java.lang.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.
java.lang.Exception
- in case the configuration object the provided XML element
represents is not recognized.public void build(BaseConfiguration config, org.w3c.dom.Element element) throws java.lang.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.
java.lang.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(java.lang.String msg)
msg
- text of the messagepublic static void logmsg(java.lang.String msg)
msg
- text of the message.public static void dump(BaseConfiguration config)
config
- configuration objectpublic void getBaseName(BaseConfiguration config, org.w3c.dom.Element elem) throws java.lang.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.
java.lang.Exception
- if could not return text from node's childrenpublic void getInheritsFrom(BaseConfiguration config, org.w3c.dom.Element elem) throws java.lang.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.
java.lang.Exception
- if could not return text from node's childrenpublic void setBaseName(BaseConfiguration config, org.w3c.dom.Element elem) throws java.lang.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.
java.lang.Exception
- if could not return text from node's childrenpublic void setInheritsFrom(BaseConfiguration config, org.w3c.dom.Element elem) throws java.lang.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.
java.lang.Exception
public void getParameters(org.w3c.dom.Element p, BaseConfiguration config) throws java.lang.Exception
p
- this is a part of the XML tree that represents the
BaseConfiguration
object.config
- an instance of the BaseConfiguration
class
java.lang.Exception
public void getParameter(org.w3c.dom.Element p, BaseConfiguration config) throws java.lang.Exception
p
- this is a part of the XML tree that represents the
BaseConfiguration
object.config
- an instance of the BaseConfiguration
class
java.lang.Exception
public org.w3c.dom.Element setParameters(org.w3c.dom.Element p, BaseConfiguration config, java.lang.String tag) throws java.lang.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
java.lang.Exception
public void setParameter(org.w3c.dom.Element p, BaseConfiguration config, java.lang.Object pname) throws java.lang.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
-
java.lang.Exception
public java.lang.String getNodeText(org.w3c.dom.Node node) throws java.lang.Exception
node
- Node object
java.lang.Exception
public org.w3c.dom.Element getSingleElement(org.w3c.dom.Element node, java.lang.String name) throws java.lang.Exception
node
- Node objectname
- name to locate
java.lang.Exception
public java.lang.String getNodeTextByName(org.w3c.dom.Element node, java.lang.String name) throws java.lang.Exception
node
- Node objectname
- child name
java.lang.Exception
public void setSingleElement(org.w3c.dom.Element node, java.lang.String tag, BaseConfiguration bc, java.lang.String name) throws java.lang.Exception
node
- Node objecttag
- XML tag namebc
- BaseConfiguration objectname
- name of the single Element
java.lang.Exception
public void setSingleElement(org.w3c.dom.Element node, java.lang.String tag, java.lang.String value) throws java.lang.Exception
node
- Node objecttag
- XML tag namevalue
- text node value
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |