de.nava.informa.utils
Class ParserUtils

java.lang.Object
  extended by de.nava.informa.utils.ParserUtils

public final class ParserUtils
extends Object

Utility class providing convenience methods to (XML) parsing mechanisms.

Author:
Niko Schmuck (niko@nava.de)

Method Summary
static String decodeBase64(String s)
           
static String escape(String value)
          Escapes the string by replacing reserved symbols with their XML entities.
static String formatDate(Date aDate)
           
static Date getDate(String strdate)
           
static Date getDateOLD(String strdate)
          Tries different date formats to parse against the given string representation to retrieve a valid Date object.
static org.jdom.Namespace getDefaultNS(org.jdom.Element element)
           
static org.jdom.Namespace getNamespace(org.jdom.Element element, String prefix)
           
static URL getURL(String toURL)
           
static void matchCaseOfChildren(org.jdom.Element root, String childName)
          Converts names of child-tags mentioned in childName list to that given case.
static void matchCaseOfChildren(org.jdom.Element root, String[] childrenNames)
          Converts names of child-tags mentioned in childrenNames list to that given case.
static String unEscape(String value)
          Unescapes the string by replacing some XML entities into plain symbols.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getURL

public static URL getURL(String toURL)

getDefaultNS

public static org.jdom.Namespace getDefaultNS(org.jdom.Element element)

getNamespace

public static org.jdom.Namespace getNamespace(org.jdom.Element element,
                                              String prefix)

getDate

public static Date getDate(String strdate)

getDateOLD

public static Date getDateOLD(String strdate)
Tries different date formats to parse against the given string representation to retrieve a valid Date object.


formatDate

public static String formatDate(Date aDate)

decodeBase64

public static String decodeBase64(String s)

unEscape

public static String unEscape(String value)
Unescapes the string by replacing some XML entities into plain symbols.

Parameters:
value - value to unescape.
Returns:
unescaped content.

escape

public static String escape(String value)
Escapes the string by replacing reserved symbols with their XML entities.

Parameters:
value - value to escape.
Returns:
escaped result.

matchCaseOfChildren

public static void matchCaseOfChildren(org.jdom.Element root,
                                       String[] childrenNames)
Converts names of child-tags mentioned in childrenNames list to that given case.

Parameters:
root - root element.
childrenNames - names of child tags to convert.

matchCaseOfChildren

public static void matchCaseOfChildren(org.jdom.Element root,
                                       String childName)
Converts names of child-tags mentioned in childName list to that given case.

Parameters:
root - root element.
childName - name of child tags to convert.


Copyright © 2002-2007 Niko Schmuck. All Rights Reserved.