|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.edustructures.sifworks.SIFWriter
public class SIFWriter
Renders a SIFElement to an XML stream in SIF format.
Agents do not typically use the SIFWriter class directly, but may do so to render a SIF Data Object or a SIF Message to an output stream. The following code demonstrates how to write a SIFDataObject to System.out:
StudentPersonal sp = ...
SIFWriter out = new SIFWriter( System.out );
out.write( sp );
| Constructor Summary | |
|---|---|
SIFWriter(java.io.OutputStream out)
Creates an instance of SIFWriter to wrap the given stream |
|
SIFWriter(java.io.OutputStream out,
boolean autoFlush)
Creates an instance of SIFWriter to wrap the given stream |
|
SIFWriter(java.io.OutputStream out,
Zone zone)
Creates an instance of SIFWriter to wrap the given stream. |
|
SIFWriter(java.io.Writer out)
Constructor |
|
SIFWriter(java.io.Writer out,
boolean autoFlush)
Constructor |
|
SIFWriter(java.io.Writer out,
Zone zone)
Constructor that allows agent properties to be passed to the SIFWriter |
|
| Method Summary | |
|---|---|
void |
clearFilter()
Clears the filter previously set with the setFilter method |
void |
close()
|
void |
flush()
|
void |
setFilter(ElementDef[] elements)
Places a filter on this SIFWriter such that only elements (and their children) identified in the array will be included in the output. |
void |
suppressNamespace(boolean suppress)
By Default, SIFWriter writes an XML Namespace when it starts writing to an element stream. |
void |
write(char[] chars)
|
void |
write(SIFDataObject o)
Write a SIF Data Object in the version of SIF in effect for that object. |
void |
write(SIFDataObjectXML o)
Write a SIF Data Object to the output stream using whatever XML content is currently defined for that object. |
void |
write(SIFElement o)
Write a SIF element in the version of SIF currently in effect for this SIFWriter. |
void |
write(SIFMessagePayload o)
Write a SIF Message in the version of SIF in effect for that object. |
void |
write(SIFVersion version,
SIFElement o)
Write a SIF element in the version of SIF specified. |
void |
write(java.lang.String value)
Writes the given string, after xml encoding it. |
void |
writeRaw(java.lang.String value)
Writes the given string without doing any xml encoding |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SIFWriter(java.io.OutputStream out)
out - The OutputStream to write to, using SIF Encoding rules
public SIFWriter(java.io.OutputStream out,
boolean autoFlush)
out - The OutputStream to write elements to, using SIF Encoding rulesautoFlush - true to flush the stream after each write
public SIFWriter(java.io.OutputStream out,
Zone zone)
The agent property, adk.compatibility.enableXMLEscaping is
checked in this constructor. If the falue is false, XmlElement and
Attribute data will not be escaped
out - The OutputStream to write elements tozone - the Zone to read properties frompublic SIFWriter(java.io.Writer out)
out - The Writer to write elements to
public SIFWriter(java.io.Writer out,
Zone zone)
The agent property, adk.compatibility.enableXMLEscaping is checked in this constructor.
If the falue is false, XmlElement and Attribute data will not be escaped
out - the Writer to write elements tozone - the Zone to read properties from
public SIFWriter(java.io.Writer out,
boolean autoFlush)
out - The Writer to write elements toautoFlush - true to flush the Writer after each write| Method Detail |
|---|
public void setFilter(ElementDef[] elements)
The filter remains in effect until the clearFilter method
is called or a null array is passed to this method.
elements - An array of ElementDef constants from the SIFDTD class
that identify elements to include in the output, or null
to clear the current filterpublic void clearFilter()
public void write(SIFMessagePayload o)
SIFMessagePayload.setSIFVersion method prior to calling
this function.
o - The SIF Message to write to the output streampublic void write(SIFDataObject o)
SIFDataObject.setSIFVersion method prior to calling
this function.
o - The SIFDataObject instance to write to the output streampublic void write(SIFDataObjectXML o)
o - The SIFDataObjectXML instance to write to the output stream
public void write(SIFVersion version,
SIFElement o)
version - The version of SIF to use when rendering the SIF elemento - The SIF Element instance to write to the output streampublic void write(SIFElement o)
o - The SIF Element instance to write to the output streampublic void writeRaw(java.lang.String value)
value - public void write(java.lang.String value)
value - public void write(char[] chars)
public void flush()
public void close()
public void suppressNamespace(boolean suppress)
suppress -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||