public class IOUtils extends Object
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAttribute(AttributesImpl ai,
String name,
Object value)
Helper method to add an attribute.
|
static ContentHandler |
getSerializer(OutputStream outputStream)
Get a serializer to write XML to a file.
|
static void |
indent(ContentHandler ch,
int level)
Helper method to indent the xml elements.
|
static void |
newline(ContentHandler ch)
Helper method to create a new line.
|
static void |
parse(InputStream file,
ContentHandler handler)
Parse a file and send the sax events to the content handler.
|
static void |
text(ContentHandler ch,
String text)
Helper method writing out a string.
|
public static final void parse(InputStream file, ContentHandler handler) throws TransformerException
file - handler - TransformerExceptionpublic static ContentHandler getSerializer(OutputStream outputStream) throws TransformerException, IOException
TransformerExceptionIOExceptionpublic static void addAttribute(AttributesImpl ai, String name, 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(ContentHandler ch, String text) throws SAXException
ch - The content handler.text - SAXExceptionpublic static void indent(ContentHandler ch, int level) throws SAXException
ch - The content handler.level - The level of indention.SAXExceptionpublic static void newline(ContentHandler ch) throws SAXException
ch - The content handler.SAXExceptionCopyright © 2006–2019 The Apache Software Foundation. All rights reserved.