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
- TransformerException
public static ContentHandler getSerializer(OutputStream outputStream) throws TransformerException, IOException
TransformerException
IOException
public 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
- SAXException
public static void indent(ContentHandler ch, int level) throws SAXException
ch
- The content handler.level
- The level of indention.SAXException
public static void newline(ContentHandler ch) throws SAXException
ch
- The content handler.SAXException
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.