Version: 1.1.1

org.biomoby.shared.parser
Class JDOMUtils

java.lang.Object
  extended by org.biomoby.shared.parser.JDOMUtils

public class JDOMUtils
extends Object


Field Summary
static org.jdom.Namespace MOBY_NS
          A Biomoby namespace.
 
Constructor Summary
JDOMUtils()
           
 
Method Summary
static ServiceException[] extractExceptions(org.jdom.Element serviceNotes)
          Extract all exceptions from a serviceNotes XML element.
static org.jdom.Element getChild(org.jdom.Element parent, String name)
          Get a child by 'name' from 'parent'.
static String getChildText(org.jdom.Element parent, String name)
          Get text of a child 'name' from 'parent'.
static org.jdom.Element toXMLElement(MobyProvisionInfo mpi)
          Turns a PIB Object into a JDOM representation.
static org.jdom.Element toXMLElement(ServiceException se)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOBY_NS

public static final org.jdom.Namespace MOBY_NS
A Biomoby namespace.

Constructor Detail

JDOMUtils

public JDOMUtils()
Method Detail

toXMLElement

public static org.jdom.Element toXMLElement(ServiceException se)

extractExceptions

public static ServiceException[] extractExceptions(org.jdom.Element serviceNotes)
Extract all exceptions from a serviceNotes XML element. This is a convenient method that can be used when dealing with an XML response from a service without parsing the whole response to a MobyPackage.

Parameters:
serviceNotes - a piece of XML <serviceNotes>...</serviceNotes>
Returns:
an array, potentially an empty array, of all exceptions extracted from the 'serviceNotes'

toXMLElement

public static org.jdom.Element toXMLElement(MobyProvisionInfo mpi)
Turns a PIB Object into a JDOM representation.


getChild

public static org.jdom.Element getChild(org.jdom.Element parent,
                                        String name)
Get a child by 'name' from 'parent'. It tries first a child withnout any namespace, then with MOBY_NS.

Parameters:
parent - whose child is returned
name - child name
Returns:
a child element, or null

getChildText

public static String getChildText(org.jdom.Element parent,
                                  String name)
Get text of a child 'name' from 'parent'. It tries first a child withnout any namespace, then with MOBY_NS.

Parameters:
parent - whose child's text is returned
name - child name
Returns:
a text from named child, or null

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010