Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.core.util
Class XmlUtilities

    java.lang.Object
      oracle.ifs.core.util.XmlUtilities

    public class XmlUtilities

extends java.lang.Object

XmlUtilities is set of static methods used to parse XML.

Field Summary
`static boolean` | `OPTIONAL` XML component that is OPTIONAL.
`static boolean` | `REQUIRED` XML component that is REQUIRED.

Method Summary
`static org.w3c.dom.Node` | `getChildNode(org.w3c.dom.Node parentNode, java.lang.String childNodeName, boolean optional)` For the specified parent node, gets the child node with a specified name.
`static java.util.List` | `getChildNodes(org.w3c.dom.Node parentNode, java.lang.String childNodeName, boolean optional)` For the specified parent node, gets the child nodes with a specified name.
`static java.lang.String` | `getChildText(org.w3c.dom.Node node)` Gets the text of the specified node.
`static boolean` | `getNodeBoolean(org.w3c.dom.Node parentNode, java.lang.String childNodeName)` Gets a boolean value represented by the node text for the specified required child of a parent node.
`static boolean` | `getNodeBoolean(org.w3c.dom.Node parentNode, java.lang.String childNodeName, boolean defaultValue)` Gets a boolean value represented by the node text for the specified optional child of a parent node.
`static java.lang.String` | `getNodeString(org.w3c.dom.Node parentNode, java.lang.String childNodeName)` Gets the node text for the specified required child of a parent node.
`static java.lang.String` | `getNodeString(org.w3c.dom.Node parentNode, java.lang.String childNodeName, java.lang.String defaultValue)` Gets the node text for the specified optional child of a parent node.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### REQUIRED

    public static boolean REQUIRED

  Description copied from class: `XmlUtilities`
  XML component that is REQUIRED.

### OPTIONAL

    public static boolean OPTIONAL

  Description copied from class: `XmlUtilities`
  XML component that is OPTIONAL.

Method Detail

### getChildNodes

    public static java.util.List getChildNodes(org.w3c.dom.Node parentNode,
                                               java.lang.String childNodeName,
                                               boolean optional)

  Description copied from class: `XmlUtilities`
  For the specified parent node, gets the child nodes with a specified name.

  If not `optional`, an exception will be thrown if there is no child node with the specified name.

  Parameters:
    `parentNode` - the parent node
    `childNodeName` - the child node name of interest
    `optional` - whether at least one child node is required
  Returns:
    a list of Nodes

### getChildNode

    public static org.w3c.dom.Node getChildNode(org.w3c.dom.Node parentNode,
                                                java.lang.String childNodeName,
                                                boolean optional)

  Description copied from class: `XmlUtilities`
  For the specified parent node, gets the child node with a specified name.

  If there exists more than one child node with the specified name, an exception will be thrown. On the other hand, if not `optional`, an exception will be thrown if there is no child node with the specified name.

  Parameters:
    `parentNode` - the parent node
    `childNodeName` - the child node name of interest
    `optional` - whether the child node is optional
  Returns:
    the child node, or null if none

### getChildText

    public static java.lang.String getChildText(org.w3c.dom.Node node)

  Description copied from class: `XmlUtilities`
  Gets the text of the specified node. Returns null if the tag is empty.

  Parameters:
    `node` - the node
  Returns:
    the text

### getNodeString

    public static java.lang.String getNodeString(org.w3c.dom.Node parentNode,
                                                 java.lang.String childNodeName,
                                                 java.lang.String defaultValue)

  Description copied from class: `XmlUtilities`
  Gets the node text for the specified optional child of a parent node. Returns the specified default value if the node is missing.

  Parameters:
    `parentNode` - the parent node
    `childNodeName` - the child node name of interest
    `defaultValue` - the default value if the node is not present
  Returns:
    the node text

### getNodeString

    public static java.lang.String getNodeString(org.w3c.dom.Node parentNode,
                                                 java.lang.String childNodeName)

  Description copied from class: `XmlUtilities`
  Gets the node text for the specified required child of a parent node. Throws a RuntimeException if the node is not specified.

  Parameters:
    `parentNode` - the parent node
    `childNodeName` - the child node name of interest
  Returns:
    the node text

### getNodeBoolean

    public static boolean getNodeBoolean(org.w3c.dom.Node parentNode,
                                         java.lang.String childNodeName,
                                         boolean defaultValue)
                                  throws IfsException

  Description copied from class: `XmlUtilities`
  Gets a boolean value represented by the node text for the specified optional child of a parent node. Returns the specified default value if the node is missing. Boolean true values can be specified as "true", "t", "yes", "y" without regard to case. Similarly false values can be specified as "false", "f", "no", and "n" without regard to case.

  Parameters:
    `parentNode` - the parent node
    `childNodeName` - the child node name of interest
    `defaultValue` - the default value if the node is not present
  Returns:
    a boolean value
  Throws:
    `IfsException` - if the operation fails

### getNodeBoolean

    public static boolean getNodeBoolean(org.w3c.dom.Node parentNode,
                                         java.lang.String childNodeName)
                                  throws IfsException

  Description copied from class: `XmlUtilities`
  Gets a boolean value represented by the node text for the specified required child of a parent node. Throws a RuntimeException if the node is not specified. Boolean true values can be specified as "true", "t", "yes", "y" without regard to case. Similarly false values can be specified as "false", "f", "no", and "n" without regard to case.

  Parameters:
    `parentNode` - the parent node
    `childNodeName` - the child node name of interest
  Returns:
    the node text
  Throws:
    `IfsException` - if the operation fails

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD