public final class XMLUtils extends Object
Modifier and Type | Method and Description |
---|---|
static XMLStreamReader |
createParser(InputStream stream)
Creates a new XML parser with OpenCMIS default settings.
|
static XMLStreamWriter |
createWriter(OutputStream out)
Creates a new XML writer.
|
static void |
endXmlDocument(XMLStreamWriter writer)
Ends a XML document.
|
static boolean |
findNextStartElemenet(XMLStreamReader parser)
Moves the parser to the next start element.
|
static Document |
newDomDocument()
Creates a new DOM document.
|
static boolean |
next(XMLStreamReader parser)
Moves the parser to the next element.
|
static Document |
parseDomDocument(InputStream stream)
Parses a stream and returns the DOM document.
|
static String |
readText(XMLStreamReader parser,
int maxLength)
Parses a tag that contains text.
|
static void |
skip(XMLStreamReader parser)
Skips a tag or subtree.
|
static void |
startXmlDocument(XMLStreamWriter writer)
Starts a XML document.
|
static void |
write(XMLStreamWriter writer,
String prefix,
String namespace,
String tag,
BigDecimal value)
Writes a Decimal tag.
|
static void |
write(XMLStreamWriter writer,
String prefix,
String namespace,
String tag,
BigInteger value)
Writes an Integer tag.
|
static void |
write(XMLStreamWriter writer,
String prefix,
String namespace,
String tag,
Boolean value)
Writes a Boolean tag.
|
static void |
write(XMLStreamWriter writer,
String prefix,
String namespace,
String tag,
Enum<?> value)
Writes an Enum tag.
|
static void |
write(XMLStreamWriter writer,
String prefix,
String namespace,
String tag,
GregorianCalendar value)
Writes a DateTime tag.
|
static void |
write(XMLStreamWriter writer,
String prefix,
String namespace,
String tag,
String value)
Writes a String tag.
|
public static XMLStreamWriter createWriter(OutputStream out) throws XMLStreamException
XMLStreamException
public static void startXmlDocument(XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void endXmlDocument(XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void write(XMLStreamWriter writer, String prefix, String namespace, String tag, String value) throws XMLStreamException
XMLStreamException
public static void write(XMLStreamWriter writer, String prefix, String namespace, String tag, BigInteger value) throws XMLStreamException
XMLStreamException
public static void write(XMLStreamWriter writer, String prefix, String namespace, String tag, BigDecimal value) throws XMLStreamException
XMLStreamException
public static void write(XMLStreamWriter writer, String prefix, String namespace, String tag, GregorianCalendar value) throws XMLStreamException
XMLStreamException
public static void write(XMLStreamWriter writer, String prefix, String namespace, String tag, Boolean value) throws XMLStreamException
XMLStreamException
public static void write(XMLStreamWriter writer, String prefix, String namespace, String tag, Enum<?> value) throws XMLStreamException
XMLStreamException
public static XMLStreamReader createParser(InputStream stream) throws XMLStreamException
XMLStreamException
public static boolean next(XMLStreamReader parser) throws XMLStreamException
XMLStreamException
public static void skip(XMLStreamReader parser) throws XMLStreamException
XMLStreamException
public static boolean findNextStartElemenet(XMLStreamReader parser) throws XMLStreamException
true
if another start element has been found,
false
otherwiseXMLStreamException
public static String readText(XMLStreamReader parser, int maxLength) throws XMLStreamException
XMLStreamException
public static Document newDomDocument() throws ParserConfigurationException
ParserConfigurationException
public static Document parseDomDocument(InputStream stream) throws ParserConfigurationException, SAXException, IOException
Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved.