public static class JaxpFunctionResolver.Helper
extends java.lang.Object
| Constructor and Description |
|---|
Helper() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.String> |
buildNameValueMap(java.util.List args)
Same as
buildNameValueMap(java.util.List, int) but index equals zero. |
static java.util.Map<java.lang.String,java.lang.String> |
buildNameValueMap(java.util.List args,
int begin)
Extract a string from each list element and build a map with them.
|
static int |
extractInteger(java.lang.Object arg)
Extract an integer from the given parameter.
The parameter could be: a List containing exactly one Node
a NodeWrapper
a Node
a String
or an Integer
In the first 3 cases, if the node type is Node.ELEMENT_NODE the (trimmed) text content is returned. |
static java.util.Map<java.lang.String,java.lang.String> |
extractNameValueMap(org.w3c.dom.Element elt)
Extract the name/value from an xml element similar too:
<elt> <foovar>bar</foovar> <myvar>value1</myvar> </elt> The local name of the element is the map key, the text content the associated value. |
static java.lang.String |
extractString(java.lang.Object arg)
Extract a string from the given parameter.
The parameter could be: a List containing exactly one Node
a NodeWrapper
a Node
or a String
In the first 3 cases, if the node type is Node.ELEMENT_NODE the (trimmed) text content is returned. |
public static java.lang.String extractString(java.lang.Object arg)
throws java.lang.IllegalArgumentException
List containing exactly one NodeNodeWrapperNodeStringNode.ELEMENT_NODE the (trimmed) text content is returned.
if the node type is Node.TEXT_NODE the (trimmed) text content is returned.
arg - java.lang.IllegalArgumentException - if none of the conditions mentioned above are metpublic static int extractInteger(java.lang.Object arg)
throws java.lang.IllegalArgumentException
List containing exactly one NodeNodeWrapperNodeStringIntegerNode.ELEMENT_NODE the (trimmed) text content is returned.
if the node type is Node.TEXT_NODE the (trimmed) text content is returned.
arg - java.lang.IllegalArgumentException - if none of the conditions mentioned above are metpublic static java.util.Map<java.lang.String,java.lang.String> extractNameValueMap(org.w3c.dom.Element elt)
public static java.util.Map<java.lang.String,java.lang.String> buildNameValueMap(java.util.List args)
buildNameValueMap(java.util.List, int) but index equals zero.buildNameValueMap(java.util.List, int)public static java.util.Map<java.lang.String,java.lang.String> buildNameValueMap(java.util.List args,
int begin)
args - the list containing a serie of name, value, name, value, and so onbegin - index of the first name to include in the map, (args.size - begin) must be an even number
or an IndexOutOfBoundsException will be thrownjava.lang.IndexOutOfBoundsExceptionextractString(Object)