org.agaveblue.slash
Class SlashHelper

java.lang.Object
  extended byorg.agaveblue.slash.SlashHelper

public class SlashHelper
extends java.lang.Object

SlashHelper is a helper class that provides convenience methods for parsing and dealing with XML.

Version:
1.0
Author:
Wade Wassenberg

Constructor Summary
SlashHelper()
           
 
Method Summary
static java.lang.String escapeXML(java.lang.String s)
          escapeXML takes a string and escapes XML reserved characters for output to XML files
static java.lang.Object parse(java.io.File file, java.util.Map hints)
          parse takes a File and SlashHandler hints, and parses the file into an object, and returns that object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlashHelper

public SlashHelper()
Method Detail

escapeXML

public static java.lang.String escapeXML(java.lang.String s)
escapeXML takes a string and escapes XML reserved characters for output to XML files

Parameters:
s - the unescaped string to escape
Returns:
the value passed in after all XML reserved characters have been escaped

parse

public static java.lang.Object parse(java.io.File file,
                                     java.util.Map hints)
                              throws org.xml.sax.SAXException,
                                     java.io.IOException,
                                     javax.xml.parsers.ParserConfigurationException,
                                     javax.xml.parsers.FactoryConfigurationError
parse takes a File and SlashHandler hints, and parses the file into an object, and returns that object.

Parameters:
file - the XML file to parse
hints - the hints to use for parsing the XML file
Returns:
the object that is constructed as a result of parsing the XML
Throws:
org.xml.sax.SAXException - thrown if the XML file is malformed, or any other parsing error occurs
java.io.IOException - thrown if an error occurs while reading the XML File
javax.xml.parsers.ParserConfigurationException - thrown if the SAX parser is not configured properly
javax.xml.parsers.FactoryConfigurationError - thrown if the SAX parser factory is not configured properly
See Also:
SlashHandler


Copyright 2008 Wade Wassenberg.
On the web: http://www.agaveblue.org/projects/slash/.
Send bug reports to slash@wass.homelinux.net.
Last Modified June 10, 2008