public class Writer extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ENCODING
The default encoding.
|
static String |
lf
The linefeed separator.
|
static String |
XML_INCLUDE_FIELDS
Constant for indicating if public fields should be written.
|
Constructor and Description |
---|
Writer(IObjectWriterHandler handler)
Create a new reader (with genids=true and indent=true).
|
Writer(IObjectWriterHandler handler,
boolean genids)
Create a new reader (with genids=true and indent=true).
|
Writer(IObjectWriterHandler handler,
boolean genids,
boolean indent)
Create a new reader.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
objectToByteArray(Writer writer,
Object val,
ClassLoader classloader)
Convert to a byte array.
|
static byte[] |
objectToByteArray(Writer writer,
Object val,
ClassLoader classloader,
Object context)
Convert to a byte array.
|
static String |
objectToXML(Writer writer,
Object val,
ClassLoader classloader)
Convert to a string.
|
static String |
objectToXML(Writer writer,
Object val,
ClassLoader classloader,
Object context)
Convert to a string.
|
void |
write(Object object,
OutputStream out,
ClassLoader classloader,
Object context)
Write the properties to an xml.
|
void |
write(Object object,
String encoding,
OutputStream out,
ClassLoader classloader,
Object context)
Write the properties to an xml.
|
void |
writeEndObject(XMLStreamWriter writer,
int level)
Write the end of an object.
|
void |
writeIndentation(XMLStreamWriter writer,
int level)
Write the indentation.
|
void |
writeObject(WriteContext wc,
Object object,
QName tag)
Write an object to xml.
|
void |
writeStartObject(XMLStreamWriter writer,
QName tag,
int level)
Write the start of an object.
|
public static final String XML_INCLUDE_FIELDS
public static final String lf
public static String DEFAULT_ENCODING
public Writer(IObjectWriterHandler handler)
handler
- The handler.public Writer(IObjectWriterHandler handler, boolean genids)
handler
- The handler.public Writer(IObjectWriterHandler handler, boolean genids, boolean indent)
handler
- The handler.public void write(Object object, OutputStream out, ClassLoader classloader, Object context) throws Exception
input
- The input stream.classloader
- The classloader.context
- The context.Exception
public void write(Object object, String encoding, OutputStream out, ClassLoader classloader, Object context) throws Exception
input
- The input stream.classloader
- The classloader.context
- The context.Exception
public void writeObject(WriteContext wc, Object object, QName tag) throws Exception
Exception
public void writeStartObject(XMLStreamWriter writer, QName tag, int level) throws Exception
Exception
public void writeEndObject(XMLStreamWriter writer, int level) throws Exception
Exception
public void writeIndentation(XMLStreamWriter writer, int level) throws Exception
Exception
public static String objectToXML(Writer writer, Object val, ClassLoader classloader)
public static String objectToXML(Writer writer, Object val, ClassLoader classloader, Object context)
public static byte[] objectToByteArray(Writer writer, Object val, ClassLoader classloader)
public static byte[] objectToByteArray(Writer writer, Object val, ClassLoader classloader, Object context)
Copyright © 2012. All Rights Reserved.