Skip navigation links

Oracle Fusion Middleware Liberty 1.2 Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10671-03


oracle.security.xmlsec.liberty.v12
Class LibertyUtils

java.lang.Object
  extended by oracle.security.xmlsec.liberty.v12.LibertyUtils


public class LibertyUtils
extends java.lang.Object

Internal use only. Class containing static utility methods for Phaos Liberty.


Method Summary
static java.lang.String collectTextFromChild(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName)
          This methods obtains the first child element of the given context element with the given local name and namespace URI.
static java.util.List collectTextFromChildren(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName)
          This methods obtains all the child elements of the given context element with the given local name and namespace URI.
static oracle.security.xmlsec.util.XMLElement getChildElement(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
          Returns the first instance of a child element with the given namespace URI and local name found within the given context element, or null if no such element exists.
static java.util.List getChildElements(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String nsURI, java.lang.String localName)
          Returns a list containing all the child elements with the given namespace URI and local name found within the given context element.
static org.w3c.dom.Element insertChildElementWithText(oracle.security.xmlsec.util.XMLElement contextElement, java.lang.String namespaceURI, java.lang.String localName, java.lang.String[] namespaceURIs, java.lang.String[] localNames, java.lang.String text, boolean replaceExisting)
          This method creates a new element with the given local name and namespace URI containing the given text.
static void setChildElement(oracle.security.xmlsec.util.XMLElement contextElement, oracle.security.xmlsec.util.XMLElement element, java.lang.String[] nsURIs, java.lang.String[] localNames)
          Inserts the given element as a child element to the given context element in the proper position, removing any existing child element with the same local name and namespace URI as the element to be inserted.

 

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

 

Method Detail

collectTextFromChild

public static java.lang.String collectTextFromChild(oracle.security.xmlsec.util.XMLElement contextElement,
                                                    java.lang.String namespaceURI,
                                                    java.lang.String localName)
This methods obtains the first child element of the given context element with the given local name and namespace URI. This method then collects all of the child element's child text nodes and returns them as a single String. This method will return null if the child element is not found or the child element has no child text nodes.
Parameters:
contextElement - The context element.
namespaceURI - The child element's namespaceURI.
localName - The child element's local name.
Returns:
The concatenation of all the child element's child text nodes, or null if the child element is not found.

collectTextFromChildren

public static java.util.List collectTextFromChildren(oracle.security.xmlsec.util.XMLElement contextElement,
                                                     java.lang.String namespaceURI,
                                                     java.lang.String localName)
This methods obtains all the child elements of the given context element with the given local name and namespace URI. For each child element, this method collects all of the child element's child text nodes and concatenates them into a single String. This method returns a list of String objects, one for each child element.

This method will return null if no child elements are found with the given local name and given namespace URI.

Parameters:
contextElement - The context element.
namespaceURI - The child elements' namespaceURI.
localName - The child elements' local name.
Returns:
A list of String objects, where each String represents the concatenation of all of a child element's child text nodes.

insertChildElementWithText

public static org.w3c.dom.Element insertChildElementWithText(oracle.security.xmlsec.util.XMLElement contextElement,
                                                             java.lang.String namespaceURI,
                                                             java.lang.String localName,
                                                             java.lang.String[] namespaceURIs,
                                                             java.lang.String[] localNames,
                                                             java.lang.String text,
                                                             boolean replaceExisting)
                                                      throws org.w3c.dom.DOMException
This method creates a new element with the given local name and namespace URI containing the given text. The element is inserted as a child element of the given context element in the correct position relative to the given child element types.
Parameters:
contextElement - The contex element.
namespaceURI - The namespace URI of the element to be inserted.
localName - The local name of the element to be inserted.
namespaceURIs - The ordered set of namespace URIs for valid child elements for the given context element.
localNames - The ordered set of local names for valid child elements for the given context element.
text - The text to be inserted into the child element.
replaceExisiting - If true, existing child elements with the given local name and namespace URI will be removed from the context element before the new child element is inserted.
Returns:
The created child element.
Throws:
org.w3c.dom.DOMException

getChildElement

public static oracle.security.xmlsec.util.XMLElement getChildElement(oracle.security.xmlsec.util.XMLElement contextElement,
                                                                     java.lang.String nsURI,
                                                                     java.lang.String localName)
Returns the first instance of a child element with the given namespace URI and local name found within the given context element, or null if no such element exists.
Parameters:
contextElement - The context element.
nsURI - The child element's namespace URI.
localName - The child element's local name.

getChildElements

public static java.util.List getChildElements(oracle.security.xmlsec.util.XMLElement contextElement,
                                              java.lang.String nsURI,
                                              java.lang.String localName)
Returns a list containing all the child elements with the given namespace URI and local name found within the given context element.
Parameters:
contextElement - The context element.
nsURI - The child elements' namespace URI.
localName - The child elements' local name.

setChildElement

public static void setChildElement(oracle.security.xmlsec.util.XMLElement contextElement,
                                   oracle.security.xmlsec.util.XMLElement element,
                                   java.lang.String[] nsURIs,
                                   java.lang.String[] localNames)
Inserts the given element as a child element to the given context element in the proper position, removing any existing child element with the same local name and namespace URI as the element to be inserted.
Parameters:
contextElement - The context element.
element - The element to be inserted.
namespaceURIs - The ordered set of namespace URIs for valid child elements for the given context element.
localNames - The ordered set of local names for valid child elements for the given context element.

Skip navigation links

Oracle Fusion Middleware Liberty 1.2 Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10671-03


Copyright © 2005, 2011 , Oracle. All rights reserved.