net.sf.joost.stx
Class HttpPostHandler

java.lang.Object
  extended by net.sf.joost.emitter.StxEmitterBase
      extended by net.sf.joost.emitter.StreamEmitter
          extended by net.sf.joost.emitter.XmlEmitter
              extended by net.sf.joost.stx.HttpPostHandler
All Implemented Interfaces:
TransformerHandler, Constants, StxEmitter, ContentHandler, DTDHandler, LexicalHandler

public class HttpPostHandler
extends XmlEmitter
implements TransformerHandler

Implements an HTTP POST connection with a TransformerHandler interface.

Version:
$Revision: 2.3 $ $Date: 2008/06/15 08:11:22 $
Author:
Oliver Becker

Field Summary
private  StringBuffer buffer
          the character buffer
private  SAXResult saxResult
          event sink for this transformer
private  String targetURL
          the target URL for the POST request
 
Fields inherited from class net.sf.joost.emitter.StreamEmitter
charsetEncoder, encoding, writer
 
Fields inherited from interface net.sf.joost.Constants
DEBUG, DEFAULT_ENCODING, FEAT_NS, FEAT_NSPREFIX, FEATURE_URI_PREFIX, FUNC_NS, JOOST_EXT_NS, PR_ATTRIBUTES, PR_BUFFER, PR_CHILDREN, PR_CONTINUE, PR_ERROR, PR_SELF, PR_SIBLINGS, STX_NS
 
Constructor Summary
HttpPostHandler(String targetURL)
           
 
Method Summary
 void endDocument()
          Sends the collected XML fragment to the specified target URL and passes the return stream to an XMLReader object, which is connected to the Result object of this TransformerHandler
 String getSystemId()
          Get the system identifier that was set with StxEmitter.setSystemId(String).
 Transformer getTransformer()
           
 void notationDecl(String name, String publicId, String systemId)
           
 void setResult(Result result)
           
 void setSystemId(String id)
          Set the system identifier for this emitter.
 void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
           
 
Methods inherited from class net.sf.joost.emitter.XmlEmitter
characters, comment, endCDATA, endElement, processingInstruction, setOmitXmlDeclaration, setSupportDisableOutputEscaping, startCDATA, startDocument, startDTD, startElement, startPrefixMapping
 
Methods inherited from class net.sf.joost.emitter.StreamEmitter
encodeCharacters, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, newEmitter, newEmitter, newEmitter, newXMLEmitter, setDocumentLocator, skippedEntity, startEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 

Field Detail

saxResult

private SAXResult saxResult
event sink for this transformer


buffer

private StringBuffer buffer
the character buffer


targetURL

private String targetURL
the target URL for the POST request

Constructor Detail

HttpPostHandler

public HttpPostHandler(String targetURL)
Method Detail

notationDecl

public void notationDecl(String name,
                         String publicId,
                         String systemId)
Specified by:
notationDecl in interface DTDHandler

unparsedEntityDecl

public void unparsedEntityDecl(String name,
                               String publicId,
                               String systemId,
                               String notationName)
Specified by:
unparsedEntityDecl in interface DTDHandler

endDocument

public void endDocument()
                 throws SAXException
Sends the collected XML fragment to the specified target URL and passes the return stream to an XMLReader object, which is connected to the Result object of this TransformerHandler

Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class XmlEmitter
Throws:
SAXException

setResult

public void setResult(Result result)
Specified by:
setResult in interface TransformerHandler

setSystemId

public void setSystemId(String id)
Description copied from interface: StxEmitter
Set the system identifier for this emitter. This is optional - the system identifier may be used to resolve relative output identifiers.

Specified by:
setSystemId in interface TransformerHandler
Specified by:
setSystemId in interface StxEmitter
Overrides:
setSystemId in class StxEmitterBase
Parameters:
id - the system identifier as a URI string

getSystemId

public String getSystemId()
Description copied from interface: StxEmitter
Get the system identifier that was set with StxEmitter.setSystemId(String).

Specified by:
getSystemId in interface TransformerHandler
Specified by:
getSystemId in interface StxEmitter
Overrides:
getSystemId in class StxEmitterBase
Returns:
the system identifier or null if StxEmitter.setSystemId(String) was not called.

getTransformer

public Transformer getTransformer()
Specified by:
getTransformer in interface TransformerHandler