public class XMLParseHelper
extends java.lang.Object
This class provides some static methods to help with XML parsing.
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getAttribute(org.w3c.dom.Node aNode,
java.lang.String attributeName)
This method will return the attribute value for an attribute inside of the
provided XML node.
|
static java.lang.String |
getAttribute(org.w3c.dom.Node aNode,
java.lang.String attributeName,
boolean encrypted)
This method will return the attribute value for an attribute inside of the
provided XML node.
|
static void |
populateAttributes(org.w3c.dom.Node aNode,
java.util.Map aProperties)
This method will get all of the attributes for a given XML node,
and populate the
Map with the attribute name as the key
and attribute value as the value. |
static void |
populateAttributes(org.w3c.dom.Node aNode,
java.util.Map aProperties,
boolean logAttributes)
This method will get all of the attributes for a given XML node,
and populate the
Map with the attribute name as the key
and attribute value as the value. |
static void |
populateBusinessContextProperties(org.w3c.dom.Node businessContextNode,
ConfigProperties configProperties)
This method adds business context properties to a
Map of properties. |
static void |
populateBusinessContextProperties(org.w3c.dom.Node businessContextNode,
java.util.Map propertyMap)
This method adds business context properties to a
Map of properties. |
static void |
populateChildProperties(org.w3c.dom.Node aNode,
java.util.Map aProperties)
This method searches XML nodes for child "property" or "contextProperty" nodes
to populate in the
Map as a set of properties. |
static void |
populateGroupPropertyMap(org.w3c.dom.Node aNode,
ConfigProperties configProperties)
This method adds a group of properties to a
Map of properties. |
static void |
populateProperties(org.w3c.dom.Node aNode,
java.util.Map aProperties)
This method will parse property nodes in the form of name-value pairs and
add them to the
Map of properties. |
static java.lang.String |
resolveVariables(java.lang.String aString)
Resolve the variable.
|
public static void populateChildProperties(org.w3c.dom.Node aNode, java.util.Map aProperties)
This method searches XML nodes for child "property" or "contextProperty" nodes
to populate in the Map
as a set of properties.
The key of the output map (aProperties) is the name attribute of a child of the node.
The value can be 1. A string if the name of child node is "property". 2. A ContextDataProperties object if the name of child node is "contextData".
aNode
- An XML node.aProperties
- The is output property map.public static void populateProperties(org.w3c.dom.Node aNode, java.util.Map aProperties)
This method will parse property nodes in the form of name-value pairs and
add them to the Map
of properties.
The key of the Map
is the property name, the value in the Map
is the property value.
aNode
- An XML node.aProperties
- A Map
to store the property name and value parsed from the XML node.public static void populateAttributes(org.w3c.dom.Node aNode, java.util.Map aProperties)
This method will get all of the attributes for a given XML node,
and populate the Map
with the attribute name as the key
and attribute value as the value.
The attribute name and value will be logged to the level Level.FINEST
aNode
- An XML node.aProperties
- A Map
to store the attribute name and value parsed from the XML node.public static void populateAttributes(org.w3c.dom.Node aNode, java.util.Map aProperties, boolean logAttributes)
This method will get all of the attributes for a given XML node,
and populate the Map
with the attribute name as the key
and attribute value as the value.
The attribute name and value will be logged to the level Level.FINEST
if
logAttributes
is true, and not if it is false.
aNode
- An XML node.aProperties
- A Map
to store the attribute name and value parsed from the XML node.logAttributes
- A flag indicating whether to log the attributes.public static java.lang.String resolveVariables(java.lang.String aString)
aString
- the input string which contains some variables.public static java.lang.String getAttribute(org.w3c.dom.Node aNode, java.lang.String attributeName, boolean encrypted)
This method will return the attribute value for an attribute inside of the provided XML node.
aNode
- An XML node.attributeName
- The name of the attribute to retrieve the value for.encrypted
- a flag to indicate if the attribute value is encrypted or not.public static java.lang.String getAttribute(org.w3c.dom.Node aNode, java.lang.String attributeName)
This method will return the attribute value for an attribute inside of the provided XML node.
aNode
- An XML node.attributeName
- The name of the attribute to retrieve the value for.public static void populateGroupPropertyMap(org.w3c.dom.Node aNode, ConfigProperties configProperties)
This method adds a group of properties to a Map
of properties.
aNode
- An XML node.configProperties
- The data load configuration properties.public static void populateBusinessContextProperties(org.w3c.dom.Node businessContextNode, ConfigProperties configProperties)
This method adds business context properties to a Map
of properties.
businessContextNode
- A BusinessContext
XML node.configProperties
- The data load configuration properties.public static void populateBusinessContextProperties(org.w3c.dom.Node businessContextNode, java.util.Map propertyMap)
This method adds business context properties to a Map
of properties.
businessContextNode
- A BusinessContext
XML node.propertyMap
- A Map
to store the business context properties.