com.wutka.jox
Class JOXBeanOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--com.wutka.jox.JOXBeanOutputStream
- public class JOXBeanOutputStream
- extends java.io.FilterOutputStream
- implements com.wutka.jox.JOXOutput
An output stream filter that writes out a bean as an XML document.
The stream can write out basic Java types, their object equivalents
and also strings, dates and other beans. The XML tag names are the
same as the bean properties.
| Fields inherited from class java.io.FilterOutputStream |
out |
|
Constructor Summary |
JOXBeanOutputStream(com.wutka.dtd.DTD dtd,
java.io.OutputStream baseOutputStream)
Create a new output stream around an existing stream and specifies
a DTD for selecting which attributes should be written and what the
names should look like. |
JOXBeanOutputStream(com.wutka.dtd.DTD dtd,
java.io.OutputStream baseOutputStream,
java.lang.String anEncoding)
Create a new output stream around an existing stream and specifies
a DTD for selecting which attributes should be written and what the
names should look like. |
JOXBeanOutputStream(java.io.OutputStream baseOutputStream)
Create a new output stream around an existing stream |
JOXBeanOutputStream(java.io.OutputStream baseOutputStream,
boolean writeAttributes)
Create a new output stream around an existing stream |
JOXBeanOutputStream(java.io.OutputStream baseOutputStream,
boolean writeAttributes,
java.lang.String anEncoding)
Create a new output stream around an existing stream |
JOXBeanOutputStream(java.io.OutputStream baseOutputStream,
java.lang.String anEncoding)
Create a new output stream around an existing stream |
JOXBeanOutputStream(java.lang.String dtdURI,
java.io.OutputStream baseOutputStream)
Create a new output stream around an existing stream and specifies
a DTD for selecting which attributes should be written and what the
names should look like. |
JOXBeanOutputStream(java.lang.String dtdURI,
java.io.OutputStream baseOutputStream,
java.lang.String anEncoding)
Create a new output stream around an existing stream and specifies
a DTD for selecting which attributes should be written and what the
names should look like. |
|
Method Summary |
void |
writeObject(java.lang.String rootName,
java.lang.Object ob)
Writes a bean as XML, using rootName as the tag name for the
document root. |
void |
writeString(java.lang.String str)
Write a string to the output stream. |
| Methods inherited from class java.io.FilterOutputStream |
close,
flush,
write,
write,
write |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DEFAULT_ENCODING
public static final java.lang.String DEFAULT_ENCODING
output
protected com.wutka.jox.JOXBeanOutput output
encoding
protected java.lang.String encoding
JOXBeanOutputStream
public JOXBeanOutputStream(java.io.OutputStream baseOutputStream)
- Create a new output stream around an existing stream
- Parameters:
baseOutputStream - The underlying output stream
JOXBeanOutputStream
public JOXBeanOutputStream(java.io.OutputStream baseOutputStream,
java.lang.String anEncoding)
- Create a new output stream around an existing stream
- Parameters:
baseOutputStream - The underlying output streamencoding - The XML encoding for the output
JOXBeanOutputStream
public JOXBeanOutputStream(java.io.OutputStream baseOutputStream,
boolean writeAttributes)
- Create a new output stream around an existing stream
- Parameters:
baseOutputStream - The underlying output streamwriteAttributes - Indicates whether we should write simple properties
as attributes
JOXBeanOutputStream
public JOXBeanOutputStream(java.io.OutputStream baseOutputStream,
boolean writeAttributes,
java.lang.String anEncoding)
- Create a new output stream around an existing stream
- Parameters:
baseOutputStream - The underlying output streamwriteAttributes - Indicates whether we should write simple properties
as attributesencoding - The XML encoding for the output
JOXBeanOutputStream
public JOXBeanOutputStream(java.lang.String dtdURI,
java.io.OutputStream baseOutputStream)
throws java.io.IOException
- Create a new output stream around an existing stream and specifies
a DTD for selecting which attributes should be written and what the
names should look like.
- Parameters:
dtdURI - The URI of the DTDbaseOutputStream - The underlying output stream
JOXBeanOutputStream
public JOXBeanOutputStream(java.lang.String dtdURI,
java.io.OutputStream baseOutputStream,
java.lang.String anEncoding)
throws java.io.IOException
- Create a new output stream around an existing stream and specifies
a DTD for selecting which attributes should be written and what the
names should look like.
- Parameters:
dtdURI - The URI of the DTDbaseOutputStream - The underlying output streamencoding - The XML encoding for the output
JOXBeanOutputStream
public JOXBeanOutputStream(com.wutka.dtd.DTD dtd,
java.io.OutputStream baseOutputStream)
throws java.io.IOException
- Create a new output stream around an existing stream and specifies
a DTD for selecting which attributes should be written and what the
names should look like.
- Parameters:
dtd - The DTD to usebaseOutputStream - The underlying output stream
JOXBeanOutputStream
public JOXBeanOutputStream(com.wutka.dtd.DTD dtd,
java.io.OutputStream baseOutputStream,
java.lang.String anEncoding)
throws java.io.IOException
- Create a new output stream around an existing stream and specifies
a DTD for selecting which attributes should be written and what the
names should look like.
- Parameters:
dtd - The DTD to usebaseOutputStream - The underlying output stream
writeObject
public void writeObject(java.lang.String rootName,
java.lang.Object ob)
throws java.io.IOException
- Writes a bean as XML, using rootName as the tag name for the
document root. Other tag names will come from the names of the
bean attributes.
- Parameters:
rootName - The name of the document rootob - The object to write out- Throws:
- java.io.IOException - If there is an error writing the object
writeString
public void writeString(java.lang.String str)
throws java.io.IOException
- Write a string to the output stream.
This method is used by the output utility to write a string
to either an output stream or a writer.
- Specified by:
- writeString in interface com.wutka.jox.JOXOutput
- Parameters:
str - The string to write