public class IOUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static javax.xml.transform.sax.SAXTransformerFactory |
FACTORY
The transformer factory.
|
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAttribute(org.xml.sax.helpers.AttributesImpl ai,
java.lang.String name,
java.lang.Object value)
Helper method to add an attribute.
|
static org.xml.sax.ContentHandler |
getSerializer(java.io.OutputStream outputStream)
Get a serializer to write XML to a file.
|
static void |
indent(org.xml.sax.ContentHandler ch,
int level)
Helper method to indent the xml elements.
|
static void |
newline(org.xml.sax.ContentHandler ch)
Helper method to create a new line.
|
static void |
parse(java.io.InputStream file,
org.xml.sax.ContentHandler handler)
Parse a file and send the sax events to the content handler.
|
static void |
text(org.xml.sax.ContentHandler ch,
java.lang.String text)
Helper method writing out a string.
|
private static final javax.xml.transform.sax.SAXTransformerFactory FACTORY
public static final void parse(java.io.InputStream file,
org.xml.sax.ContentHandler handler)
throws javax.xml.transform.TransformerException
file - handler - javax.xml.transform.TransformerExceptionpublic static org.xml.sax.ContentHandler getSerializer(java.io.OutputStream outputStream)
throws javax.xml.transform.TransformerException,
java.io.IOException
javax.xml.transform.TransformerExceptionjava.io.IOExceptionpublic static void addAttribute(org.xml.sax.helpers.AttributesImpl ai,
java.lang.String name,
java.lang.Object value)
ai - The attributes impl receiving the additional attribute.name - The name of the attribute.value - The value of the attribute.public static void text(org.xml.sax.ContentHandler ch,
java.lang.String text)
throws org.xml.sax.SAXException
ch - The content handler.text - org.xml.sax.SAXExceptionpublic static void indent(org.xml.sax.ContentHandler ch,
int level)
throws org.xml.sax.SAXException
ch - The content handler.level - The level of indention.org.xml.sax.SAXExceptionpublic static void newline(org.xml.sax.ContentHandler ch)
throws org.xml.sax.SAXException
ch - The content handler.org.xml.sax.SAXException