public final class XmlUtil extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
XmlUtil.XmlEventHandler |
static interface |
XmlUtil.XmlEventHandlerWithDepth
An richer event handler which give element depth with each start event.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
readBoolAttribute(XMLStreamReader reader,
String attributeName) |
static double |
readDoubleAttribute(XMLStreamReader reader,
String attributeName) |
static float |
readFloatAttribute(XMLStreamReader reader,
String attributeName) |
static int |
readIntAttribute(XMLStreamReader reader,
String attributeName) |
static boolean |
readOptionalBoolAttribute(XMLStreamReader reader,
String attributeName,
boolean defaultValue) |
static double |
readOptionalDoubleAttribute(XMLStreamReader reader,
String attributeName) |
static double |
readOptionalDoubleAttribute(XMLStreamReader reader,
String attributeName,
double defaultValue) |
static float |
readOptionalFloatAttribute(XMLStreamReader reader,
String attributeName) |
static float |
readOptionalFloatAttribute(XMLStreamReader reader,
String attributeName,
float defaultValue) |
static Integer |
readOptionalIntegerAttribute(XMLStreamReader reader,
String attributeName) |
static int |
readOptionalIntegerAttribute(XMLStreamReader reader,
String attributeName,
int defaultValue) |
static String |
readUntilEndElement(String endElementName,
XMLStreamReader reader,
XmlUtil.XmlEventHandler eventHandler) |
static String |
readUntilEndElementWithDepth(String endElementName,
XMLStreamReader reader,
XmlUtil.XmlEventHandlerWithDepth eventHandler) |
static void |
writeDouble(String name,
double value,
XMLStreamWriter writer) |
static void |
writeFloat(String name,
float value,
XMLStreamWriter writer) |
static void |
writeInt(String name,
int value,
XMLStreamWriter writer) |
static void |
writeOptionalBoolean(String name,
boolean value,
boolean absentValue,
XMLStreamWriter writer) |
static void |
writeOptionalDouble(String name,
double value,
double absentValue,
XMLStreamWriter writer) |
static void |
writeOptionalFloat(String name,
float value,
float absentValue,
XMLStreamWriter writer) |
static void |
writeOptionalInt(String name,
int value,
int absentValue,
XMLStreamWriter writer) |
static void |
writeOptionalString(String name,
String value,
XMLStreamWriter writer) |
public static String readUntilEndElement(String endElementName, XMLStreamReader reader, XmlUtil.XmlEventHandler eventHandler) throws XMLStreamException
XMLStreamException
public static String readUntilEndElementWithDepth(String endElementName, XMLStreamReader reader, XmlUtil.XmlEventHandlerWithDepth eventHandler) throws XMLStreamException
XMLStreamException
public static void writeOptionalBoolean(String name, boolean value, boolean absentValue, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void writeDouble(String name, double value, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void writeOptionalDouble(String name, double value, double absentValue, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void writeFloat(String name, float value, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void writeOptionalFloat(String name, float value, float absentValue, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void writeInt(String name, int value, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void writeOptionalInt(String name, int value, int absentValue, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static void writeOptionalString(String name, String value, XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static int readIntAttribute(XMLStreamReader reader, String attributeName)
public static boolean readBoolAttribute(XMLStreamReader reader, String attributeName)
public static boolean readOptionalBoolAttribute(XMLStreamReader reader, String attributeName, boolean defaultValue)
public static double readDoubleAttribute(XMLStreamReader reader, String attributeName)
public static double readOptionalDoubleAttribute(XMLStreamReader reader, String attributeName)
public static double readOptionalDoubleAttribute(XMLStreamReader reader, String attributeName, double defaultValue)
public static Integer readOptionalIntegerAttribute(XMLStreamReader reader, String attributeName)
public static int readOptionalIntegerAttribute(XMLStreamReader reader, String attributeName, int defaultValue)
public static float readFloatAttribute(XMLStreamReader reader, String attributeName)
public static float readOptionalFloatAttribute(XMLStreamReader reader, String attributeName)
public static float readOptionalFloatAttribute(XMLStreamReader reader, String attributeName, float defaultValue)
Copyright © 2020. All rights reserved.