com.ssx.xml.output
Interface XmlSink

All Known Implementing Classes:
SaxSink, TextSink

public interface XmlSink

An XmlSink responds to method calls by producing an XML document. The Sink can assume that their methods will be called in the proper order with data values that are valid for the respective XML node. XmlSinks are used by the XmlOutput class. An XmlOutputException should be thrown on any error.


Method Summary
 void close()
          The user has finished providing XML.
 void comment(String content)
          Add a comment
 void endElement(Namespace namespace, String name, List namespaceList, boolean empty)
          End an element.
 void instruction(String target, String data)
          Add a processing instruction
 void open()
          This method will be called before any other methods, after the user has provided the first xml node
 void startElement(Namespace namespace, String name, AttributeList attributes, List namespaceList, boolean empty)
          Start a new element
 void text(String text)
          Add character data
 

Method Detail

open

public void open()
This method will be called before any other methods, after the user has provided the first xml node


startElement

public void startElement(Namespace namespace,
                         String name,
                         AttributeList attributes,
                         List namespaceList,
                         boolean empty)
Start a new element

Parameters:
namespace - The element namespace
name - The element name
attributes - The element attributes
namespaceList - The namespaces declared in this element
empty - True if the element contains no other nodes

endElement

public void endElement(Namespace namespace,
                       String name,
                       List namespaceList,
                       boolean empty)
End an element. If empty is true it indicates that the body of the element is empty.

Parameters:
namespace - The element namespace
name - The element name
namespaceList - The namespaces that were declared in this element
empty - True if the element contains no other nodes

text

public void text(String text)
Add character data

Parameters:
text - The String to add as character data

instruction

public void instruction(String target,
                        String data)
Add a processing instruction

Parameters:
target - The PI target
data - The PI data - structure depends on the PI

comment

public void comment(String content)
Add a comment

Parameters:
content - The text content of the comment

close

public void close()
The user has finished providing XML. No other methods will be called after this.