@ThreadSafe public class XMLColumnAppender extends Object
Constructor and Description |
---|
XMLColumnAppender(Appendable _sink)
Constructs an XMLColumnAppender.
|
Modifier and Type | Method and Description |
---|---|
void |
appendAttribute(String name,
String value)
Serializes the specified datum as a space character followed by an attribute
declaration and appends it to the sink, or does nothing if the value is null.
|
static String |
booleanToString(boolean b)
Returns a non-empty string if b is true, or null otherwise.
|
static String |
byteToString(byte n)
Returns null if n is 0, otherwise the standard string representation of n.
|
static String |
longToString(long n)
Returns null if n is 0L, otherwise the standard string representation of n.
|
static XMLStreamReader |
newStreamReader(Reader reader)
Constructs a stream reader configured to read the serialized XML.
|
static XMLStreamReader |
newStreamReader(String systemId,
InputStream in)
Constructs a stream reader configured to read the serialized XML.
|
static XMLStreamReader |
newStreamReader(String systemId,
Reader reader)
Constructs a stream reader configured to read the serialized XML.
|
Appendable |
sink()
The underlying sink for the XML serialization.
|
static boolean |
stringToBoolean(String s)
Returns true if s is non-null and non-empty, or false otherwise.
|
static byte |
stringToByte(String s)
Returns 0 if s is null or empty, otherwise the parsed value of s.
|
static long |
stringToLong(String s)
Returns 0L if s is null or empty, otherwise the parsed value of s.
|
public XMLColumnAppender(Appendable _sink)
sink()
public void appendAttribute(String name, String value) throws IOException
name
- a valid XML name for the attribute.value
- the value of the datum, or null to append nothing.IllegalArgumentException
- if the value is empty, as currently that is
not supported.IOException
public static String booleanToString(boolean b)
stringToBoolean(String)
public static boolean stringToBoolean(String s)
booleanToString(boolean)
public static String byteToString(byte n)
stringToByte(String)
public static byte stringToByte(String s)
byteToString(byte)
public static String longToString(long n)
stringToLong(String)
public static long stringToLong(String s)
longToString(long)
public static XMLStreamReader newStreamReader(Reader reader) throws XMLStreamException
XMLStreamException
public static XMLStreamReader newStreamReader(String systemId, InputStream in) throws XMLStreamException
XMLStreamException
public static XMLStreamReader newStreamReader(String systemId, Reader reader) throws XMLStreamException
XMLStreamException
public Appendable sink()