project35.util
Class Project35XMLParsingUtility

java.lang.Object
  extended by project35.util.Project35XMLParsingUtility

public class Project35XMLParsingUtility
extends Object

convenience routines used to parse XML files and XML schemas


Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.

Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net), code contributions from 2002 - September 30, 2007.

Constructor Summary
Project35XMLParsingUtility()
           
 
Method Summary
protected  String createInlineImage(String fieldValue)
           
static String escapeXml(String str)
          Convenience method for escaping XML characters in a given String.
static String getCData(Element element)
           
static Element getElement(Node node, String tagName)
           
protected  Element getElement(Node node, String tagName, String elementName)
           
static String getFieldValue(Element element)
          convenience routine for extracting the text value for an element
static Element getFirstChildElement(Node node)
           
static Element getNextSiblingElement(Element element)
           
static Parameter[] getParameters(Element parametersElement)
          this method assumes that all tag children of parameters element can be bundled into name value pairs (see class project35.util.Parameter)
static String getValue(Element element)
           
 boolean interpretBooleanValue(String value)
           
 int interpretIntegerValue(String value)
           
protected static boolean isRequired(String minOccurs)
           
protected static boolean isRequiredOrOptional(String minOccurs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Project35XMLParsingUtility

public Project35XMLParsingUtility()
Method Detail

escapeXml

public static String escapeXml(String str)
Convenience method for escaping XML characters in a given String. It translates: The method does not throw a NullPointerException if the given String is null. Instead, it returns a null.

Parameters:
str - The string to be escaped.
Returns:
the string with all XML characters escaped.

isRequired

protected static boolean isRequired(String minOccurs)

isRequiredOrOptional

protected static boolean isRequiredOrOptional(String minOccurs)

getNextSiblingElement

public static Element getNextSiblingElement(Element element)

getFieldValue

public static String getFieldValue(Element element)
convenience routine for extracting the text value for an element


getFirstChildElement

public static Element getFirstChildElement(Node node)

getParameters

public static Parameter[] getParameters(Element parametersElement)
this method assumes that all tag children of parameters element can be bundled into name value pairs (see class project35.util.Parameter)


getCData

public static String getCData(Element element)

getElement

public static Element getElement(Node node,
                                 String tagName)

getElement

protected Element getElement(Node node,
                             String tagName,
                             String elementName)

getValue

public static String getValue(Element element)

interpretIntegerValue

public int interpretIntegerValue(String value)
                          throws Exception
Throws:
Exception

interpretBooleanValue

public boolean interpretBooleanValue(String value)

createInlineImage

protected String createInlineImage(String fieldValue)