org.apache.ode.bpel.elang.xpath20.runtime

## Class JaxpFunctionResolver.Helper

- java.lang.Object
- - org.apache.ode.bpel.elang.xpath20.runtime.JaxpFunctionResolver.Helper

- Enclosing class:
    JaxpFunctionResolver

      public static class JaxpFunctionResolver.Helper
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Helper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Helper

          public Helper()

  - ### Method Detail

    - #### extractString

          public static java.lang.String extractString(java.lang.Object arg)
                                                throws java.lang.IllegalArgumentException

      Extract a string from the given parameter.
      The parameter could be:
      1. a `List` containing exactly one `Node`
      2. a `NodeWrapper`
      3. a `Node`
      4. or a `String`
      In the first 3 cases, if the node type is `Node.ELEMENT_NODE` the (trimmed) text content is returned. if the node type is `Node.TEXT_NODE` the (trimmed) text content is returned.

      Parameters:
        `arg` -
      Returns:
        a string
      Throws:
        `java.lang.IllegalArgumentException` - if none of the conditions mentioned above are met

    - #### extractInteger

          public static int extractInteger(java.lang.Object arg)
                                    throws java.lang.IllegalArgumentException

      Extract an integer from the given parameter.
      The parameter could be:
      1. a `List` containing exactly one `Node`
      2. a `NodeWrapper`
      3. a `Node`
      4. a `String`
      5. or an `Integer`
      In the first 3 cases, if the node type is `Node.ELEMENT_NODE` the (trimmed) text content is returned. if the node type is `Node.TEXT_NODE` the (trimmed) text content is returned.

      Parameters:
        `arg` -
      Returns:
        a string
      Throws:
        `java.lang.IllegalArgumentException` - if none of the conditions mentioned above are met

    - #### extractNameValueMap

          public 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.
      Returns:
        a Map of name/value pair

    - #### buildNameValueMap

          public 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.
      See Also:
        `buildNameValueMap(java.util.List, int)`

    - #### buildNameValueMap

          public 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.
      Elements at even indices would be the keys, Elements at odd indices the values.
      Parameters:
        `args` - the list containing a serie of name, value, name, value, and so on
        `begin` - index of the first name to include in the map, (args.size - begin) must be an even number or an IndexOutOfBoundsException will be thrown
      Returns:
        a Map of name/value pairs
      Throws:
        `java.lang.IndexOutOfBoundsException`
      See Also:
        `extractString(Object)`