com.filenet.eforms.api

Class P8XMLUtil

  1. java.lang.Object
  2. extended bycom.filenet.eforms.api.P8XMLUtil

  1. public class P8XMLUtil
  2. extends java.lang.Object

Method Summary

Modifier and Type Method and Description
  1. protected static
  2. void
addChildren(java.util.ArrayList childList,org.w3c.dom.Node parent,java.lang.String nameToFind)
Helper method to add any child nodes that match the passed in tag name to the child list.
  1. static
  2. org.w3c.dom.Node
getChildNode(org.w3c.dom.Node parent,java.lang.String nameToFind)
Helper method to find a child node under a parent.
  1. static
  2. java.lang.String
getChildNodeText(org.w3c.dom.Node parent,java.lang.String nameToFind)
Helper method to find a child node under a parent and return it's text value.
  1. static
  2. org.w3c.dom.Node
getChildNodeWithValue(java.util.ArrayList childList,java.lang.String nameToFind,java.lang.String valueToFind)
Helper method to find a child node in a list of node that has a particular value.
  1. static
  2. org.w3c.dom.Document
getDocumentFromInputStream(java.io.InputStream inputStream)
  1. static
  2. java.lang.String
getNodeText(org.w3c.dom.Node node)
Helper method to get the text value of a specified node.
  1. static
  2. org.w3c.dom.Node
getSelectNode(org.w3c.dom.Node parent,java.lang.String pathToNode)
Helper method to find a child node under a parent.
  1. static
  2. java.util.ArrayList
getSelectNodeList(org.w3c.dom.Node parent,java.lang.String pathToNode)
Helper method to retrieve an array list of children under a parent node.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

getDocumentFromInputStream

  1. public static org.w3c.dom.Document getDocumentFromInputStream( java.io.InputStream inputStream)
  2. throws java.io.IOException
  3. org.xml.sax.SAXException
  4. javax.xml.parsers.ParserConfigurationException
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

getChildNode

  1. public static org.w3c.dom.Node getChildNode( org.w3c.dom.Node parent,
  2. java.lang.String nameToFind)
  3. throws java.lang.Exception
Helper method to find a child node under a parent. Does not use xpath!
Parameters:
parent - Node holding the parent
nameToFind - String holding the XML element tag name to look for under the parent node.
Returns:
Node object of child that matches the passed in tag name.
Throws:
java.lang.Exception - If there are problems retrieving data or with an invalid parameter.

getSelectNode

  1. public static org.w3c.dom.Node getSelectNode( org.w3c.dom.Node parent,
  2. java.lang.String pathToNode)
  3. throws java.lang.Exception
Helper method to find a child node under a parent. Does not use xpath!
Parameters:
parent - Node holding the parent
pathToNode - String holding simple XML tag path (ie: "propdesc/symname"). Does not use xpath, and therfore does not handle queries (ie: "propdesc[symname = 'myprop'].
Returns:
Node object of child that matches the passed in tag name.
Throws:
java.lang.Exception - If there are problems retrieving data or with an invalid parameter.

getChildNodeText

  1. public static java.lang.String getChildNodeText( org.w3c.dom.Node parent,
  2. java.lang.String nameToFind)
  3. throws java.lang.Exception
Helper method to find a child node under a parent and return it's text value. Does not use xpath!
Parameters:
parent - Node holding the parent
nameToFind - String holding the XML element tag name to look for under the parent node.
Returns:
String text value of child node to find.
Throws:
java.lang.Exception - If there are problems retrieving data or with an invalid parameter.

getNodeText

  1. public static java.lang.String getNodeText( org.w3c.dom.Node node)
Helper method to get the text value of a specified node.
Parameters:
node - Node object to find value
Returns:
String text value of specified node

getSelectNodeList

  1. public static java.util.ArrayList getSelectNodeList( org.w3c.dom.Node parent,
  2. java.lang.String pathToNode)
  3. throws java.lang.Exception
Helper method to retrieve an array list of children under a parent node. Does not use xpath.
Parameters:
parent - Node holding the parent
pathToNode - String holding simple XML tag path (ie: "propdesc/symname"). Does not use xpath, and therfore does not handle queries (ie: "propdesc[symname = 'myprop'].
Returns:
ArrayList of child Node objects.
Throws:
java.lang.Exception - If there are problems retrieving data or with an invalid parameter.

getChildNodeWithValue

  1. public static org.w3c.dom.Node getChildNodeWithValue( java.util.ArrayList childList,
  2. java.lang.String nameToFind,
  3. java.lang.String valueToFind)
  4. throws java.lang.Exception
Helper method to find a child node in a list of node that has a particular value. Does not use xpath!
Parameters:
childList - ArrayList holding the child node to look through
nameToFind - String holding the XML element tag name to look for under the parent node.
valueToFind - String holding the XML element value to look for under the child node mathcing the name.
Returns:
Node object of child that matches the passed in tag name.
Throws:
java.lang.Exception - If there are problems retrieving data or with an invalid parameter.

addChildren

  1. protected static void addChildren( java.util.ArrayList childList,
  2. org.w3c.dom.Node parent,
  3. java.lang.String nameToFind)
Helper method to add any child nodes that match the passed in tag name to the child list.
Parameters:
childList - ArrayList holding the current list of children
parent - Node to for children thath match the specified tag.
nameToFind - String holding XML element name to look for.