org.apache.manifoldcf.agents.common
Class XMLWriterContext

java.lang.Object
  extended by org.apache.manifoldcf.agents.common.XMLContext
      extended by org.apache.manifoldcf.agents.common.XMLWriterContext
Direct Known Subclasses:
XMLOutputStreamContext

public class XMLWriterContext
extends XMLContext

An instance of this class represents a parsing context within a node. Data is written to the supplied writer.


Field Summary
protected  java.io.Writer theWriter
          The writer
 
Fields inherited from class org.apache.manifoldcf.agents.common.XMLContext
localname, namespaceURI, previousContext, qname, theseAttributes, theStream
 
Constructor Summary
XMLWriterContext(XMLStream theStream, java.lang.String namespaceURI, java.lang.String localname, java.lang.String qname, org.xml.sax.Attributes theseAttributes, java.io.Writer writer)
          Full constructor.
 
Method Summary
protected  XMLContext beginTag(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Start a child tag.
protected  void endTag()
          End a child tag.
protected static java.lang.String escapeAttribute(java.lang.String value)
          Convert a string to a value that's safe to include inside an attribute value
 void flush()
          Flush the data to the underlying output stream
protected  void tagContents(char[] ch, int start, int length)
          This method is meant to be extended by classes that extend this class
 
Methods inherited from class org.apache.manifoldcf.agents.common.XMLContext
characters, cleanup, endDocument, endElement, getAttribute, getLocalname, getNamespaceURI, getQname, startDocument, startElement, tagCleanup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theWriter

protected java.io.Writer theWriter
The writer

Constructor Detail

XMLWriterContext

public XMLWriterContext(XMLStream theStream,
                        java.lang.String namespaceURI,
                        java.lang.String localname,
                        java.lang.String qname,
                        org.xml.sax.Attributes theseAttributes,
                        java.io.Writer writer)
                 throws ManifoldCFException
Full constructor. Used for individual tags.

Throws:
ManifoldCFException
Method Detail

flush

public void flush()
           throws ManifoldCFException
Flush the data to the underlying output stream

Throws:
ManifoldCFException

tagContents

protected void tagContents(char[] ch,
                           int start,
                           int length)
                    throws ManifoldCFException
This method is meant to be extended by classes that extend this class

Overrides:
tagContents in class XMLContext
Throws:
ManifoldCFException

beginTag

protected XMLContext beginTag(java.lang.String namespaceURI,
                              java.lang.String localName,
                              java.lang.String qName,
                              org.xml.sax.Attributes atts)
                       throws ManifoldCFException,
                              ServiceInterruption
Start a child tag. The XMLWriterContext accepts all subtags in their text form.

Overrides:
beginTag in class XMLContext
Throws:
ManifoldCFException
ServiceInterruption

endTag

protected void endTag()
               throws ManifoldCFException,
                      ServiceInterruption
End a child tag. The XMLWriterContext accepts all subtags in their text form.

Overrides:
endTag in class XMLContext
Throws:
ManifoldCFException
ServiceInterruption

escapeAttribute

protected static java.lang.String escapeAttribute(java.lang.String value)
Convert a string to a value that's safe to include inside an attribute value