org.jasig.portal.serialize
Class DebugCachingSerializer

java.lang.Object
  extended by org.jasig.portal.serialize.DebugCachingSerializer
All Implemented Interfaces:
IAnchoringSerializer, CachingSerializer, DOMSerializer, MarkupSerializer, Serializer, ContentHandler, DocumentHandler, DTDHandler, DeclHandler, LexicalHandler

public class DebugCachingSerializer
extends Object
implements CachingSerializer


Constructor Summary
DebugCachingSerializer()
           
 
Method Summary
 ContentHandler asContentHandler()
          Return a ContentHandler interface into this serializer.
 DocumentHandler asDocumentHandler()
          Return a DocumentHandler interface into this serializer.
 DOMSerializer asDOMSerializer()
          Return a DOMSerializer interface into this serializer.
 void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4)
           
 void characters(char[] arg0, int arg1, int arg2)
           
 void comment(char[] arg0, int arg1, int arg2)
           
 void elementDecl(String arg0, String arg1)
           
 void endCDATA()
           
 void endDocument()
           
 void endDTD()
           
 void endElement(String arg0)
           
 void endElement(String arg0, String arg1, String arg2)
           
 void endEntity(String arg0)
           
 void endPrefixMapping(String arg0)
           
 void externalEntityDecl(String arg0, String arg1, String arg2)
           
 void flush()
          Flushes all the buffers
 String getCache()
          Asks serializer for an accumulated cache content.
 void ignorableWhitespace(char[] arg0, int arg1, int arg2)
           
 void internalEntityDecl(String arg0, String arg1)
           
 void notationDecl(String arg0, String arg1, String arg2)
           
 void printRawCharacters(String text)
          Allows one to print a String of characters directly to the output stream.
 void processingInstruction(String arg0, String arg1)
           
 void serialize(Document doc)
          Serializes the DOM document.
 void serialize(DocumentFragment frag)
          Serializes the DOM document fragment.
 void serialize(Element elem)
          Serialized the DOM element.
 void setDocumentLocator(Locator arg0)
           
 void setDocumentStarted(boolean setting)
          Let the serializer know if the document has already been started.
 void setOutputByteStream(OutputStream output)
          Specifies an output stream to which the document should be serialized.
 void setOutputCharStream(Writer output)
          Specifies a writer to which the document should be serialized.
 void setOutputFormat(OutputFormat format)
          Specifies an output format for this serializer.
 void skippedEntity(String arg0)
           
 void startAnchoring(String anchorId)
          Signify that the serializer should begin to append the anchor ID to URLs of its choosing.
 boolean startCaching()
          Commands serializer to start caching.
 void startCDATA()
           
 void startDocument()
           
 void startDTD(String arg0, String arg1, String arg2)
           
 void startElement(String arg0, AttributeList arg1)
           
 void startElement(String arg0, String arg1, String arg2, Attributes arg3)
           
 void startEntity(String arg0)
           
 void startPrefixMapping(String arg0, String arg1)
           
 void stopAnchoring()
          Signify that anchoring is no longer desired by the serializer.
 boolean stopCaching()
          Commands serializer to stop caching.
 void unparsedEntityDecl(String arg0, String arg1, String arg2, String arg3)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugCachingSerializer

public DebugCachingSerializer()
Method Detail

flush

public void flush()
           throws IOException
Description copied from interface: CachingSerializer
Flushes all the buffers

Specified by:
flush in interface CachingSerializer
Specified by:
flush in interface MarkupSerializer
Throws:
IOException - if an error occurs

getCache

public String getCache()
                throws UnsupportedEncodingException,
                       IOException
Description copied from interface: CachingSerializer
Asks serializer for an accumulated cache content.

Specified by:
getCache in interface CachingSerializer
Returns:
a String cache.
Throws:
UnsupportedEncodingException - if the OutputFormat specified unsupported encoding
IOException

printRawCharacters

public void printRawCharacters(String text)
                        throws IOException
Description copied from interface: CachingSerializer
Allows one to print a String of characters directly to the output stream.

Specified by:
printRawCharacters in interface CachingSerializer
Parameters:
text - a String value
Throws:
IOException

setDocumentStarted

public void setDocumentStarted(boolean setting)
Description copied from interface: CachingSerializer
Let the serializer know if the document has already been started.

Specified by:
setDocumentStarted in interface CachingSerializer
Parameters:
setting - a boolean value

startCaching

public boolean startCaching()
                     throws IOException
Description copied from interface: CachingSerializer
Commands serializer to start caching.

Specified by:
startCaching in interface CachingSerializer
Returns:
false if the serializer is already caching.
Throws:
IOException

stopCaching

public boolean stopCaching()
                    throws IOException
Description copied from interface: CachingSerializer
Commands serializer to stop caching.

Specified by:
stopCaching in interface CachingSerializer
Returns:
false if the serializer was NOT caching.
Throws:
IOException

characters

public void characters(char[] arg0,
                       int arg1,
                       int arg2)
                throws SAXException
Specified by:
characters in interface ContentHandler
Specified by:
characters in interface DocumentHandler
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Specified by:
endDocument in interface DocumentHandler
Throws:
SAXException

endElement

public void endElement(String arg0,
                       String arg1,
                       String arg2)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Throws:
SAXException

endPrefixMapping

public void endPrefixMapping(String arg0)
                      throws SAXException
Specified by:
endPrefixMapping in interface ContentHandler
Throws:
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] arg0,
                                int arg1,
                                int arg2)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Specified by:
ignorableWhitespace in interface DocumentHandler
Throws:
SAXException

processingInstruction

public void processingInstruction(String arg0,
                                  String arg1)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
Specified by:
processingInstruction in interface DocumentHandler
Throws:
SAXException

setDocumentLocator

public void setDocumentLocator(Locator arg0)
Specified by:
setDocumentLocator in interface ContentHandler
Specified by:
setDocumentLocator in interface DocumentHandler

skippedEntity

public void skippedEntity(String arg0)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
Throws:
SAXException

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Specified by:
startDocument in interface DocumentHandler
Throws:
SAXException

startElement

public void startElement(String arg0,
                         String arg1,
                         String arg2,
                         Attributes arg3)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Throws:
SAXException

startPrefixMapping

public void startPrefixMapping(String arg0,
                               String arg1)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
Throws:
SAXException

endElement

public void endElement(String arg0)
                throws SAXException
Specified by:
endElement in interface DocumentHandler
Throws:
SAXException

startElement

public void startElement(String arg0,
                         AttributeList arg1)
                  throws SAXException
Specified by:
startElement in interface DocumentHandler
Throws:
SAXException

comment

public void comment(char[] arg0,
                    int arg1,
                    int arg2)
             throws SAXException
Specified by:
comment in interface LexicalHandler
Throws:
SAXException

endCDATA

public void endCDATA()
              throws SAXException
Specified by:
endCDATA in interface LexicalHandler
Throws:
SAXException

endDTD

public void endDTD()
            throws SAXException
Specified by:
endDTD in interface LexicalHandler
Throws:
SAXException

endEntity

public void endEntity(String arg0)
               throws SAXException
Specified by:
endEntity in interface LexicalHandler
Throws:
SAXException

startCDATA

public void startCDATA()
                throws SAXException
Specified by:
startCDATA in interface LexicalHandler
Throws:
SAXException

startDTD

public void startDTD(String arg0,
                     String arg1,
                     String arg2)
              throws SAXException
Specified by:
startDTD in interface LexicalHandler
Throws:
SAXException

startEntity

public void startEntity(String arg0)
                 throws SAXException
Specified by:
startEntity in interface LexicalHandler
Throws:
SAXException

notationDecl

public void notationDecl(String arg0,
                         String arg1,
                         String arg2)
                  throws SAXException
Specified by:
notationDecl in interface DTDHandler
Throws:
SAXException

unparsedEntityDecl

public void unparsedEntityDecl(String arg0,
                               String arg1,
                               String arg2,
                               String arg3)
                        throws SAXException
Specified by:
unparsedEntityDecl in interface DTDHandler
Throws:
SAXException

attributeDecl

public void attributeDecl(String arg0,
                          String arg1,
                          String arg2,
                          String arg3,
                          String arg4)
                   throws SAXException
Specified by:
attributeDecl in interface DeclHandler
Throws:
SAXException

elementDecl

public void elementDecl(String arg0,
                        String arg1)
                 throws SAXException
Specified by:
elementDecl in interface DeclHandler
Throws:
SAXException

externalEntityDecl

public void externalEntityDecl(String arg0,
                               String arg1,
                               String arg2)
                        throws SAXException
Specified by:
externalEntityDecl in interface DeclHandler
Throws:
SAXException

internalEntityDecl

public void internalEntityDecl(String arg0,
                               String arg1)
                        throws SAXException
Specified by:
internalEntityDecl in interface DeclHandler
Throws:
SAXException

serialize

public void serialize(Element elem)
               throws IOException
Description copied from interface: DOMSerializer
Serialized the DOM element. Throws an exception only if an I/O exception occured while serializing.

Specified by:
serialize in interface DOMSerializer
Parameters:
elem - The element to serialize
Throws:
IOException - An I/O exception occured while serializing

serialize

public void serialize(Document doc)
               throws IOException
Description copied from interface: DOMSerializer
Serializes the DOM document. Throws an exception only if an I/O exception occured while serializing.

Specified by:
serialize in interface DOMSerializer
Parameters:
doc - The document to serialize
Throws:
IOException - An I/O exception occured while serializing

serialize

public void serialize(DocumentFragment frag)
               throws IOException
Description copied from interface: DOMSerializer
Serializes the DOM document fragment. Throws an exception only if an I/O exception occured while serializing.

Specified by:
serialize in interface DOMSerializer
Parameters:
frag - The document fragment to serialize
Throws:
IOException - An I/O exception occured while serializing

asContentHandler

public ContentHandler asContentHandler()
                                throws IOException
Description copied from interface: Serializer
Return a ContentHandler interface into this serializer. If the serializer does not support the ContentHandler interface, it should return null.

Specified by:
asContentHandler in interface Serializer
Throws:
IOException

asDOMSerializer

public DOMSerializer asDOMSerializer()
                              throws IOException
Description copied from interface: Serializer
Return a DOMSerializer interface into this serializer. If the serializer does not support the DOMSerializer interface, it should return null.

Specified by:
asDOMSerializer in interface Serializer
Throws:
IOException

asDocumentHandler

public DocumentHandler asDocumentHandler()
                                  throws IOException
Description copied from interface: Serializer
Return a DocumentHandler interface into this serializer. If the serializer does not support the DocumentHandler interface, it should return null.

Specified by:
asDocumentHandler in interface Serializer
Throws:
IOException

setOutputByteStream

public void setOutputByteStream(OutputStream output)
Description copied from interface: Serializer
Specifies an output stream to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document.

Specified by:
setOutputByteStream in interface Serializer

setOutputCharStream

public void setOutputCharStream(Writer output)
Description copied from interface: Serializer
Specifies a writer to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document.

Specified by:
setOutputCharStream in interface Serializer

setOutputFormat

public void setOutputFormat(OutputFormat format)
Description copied from interface: Serializer
Specifies an output format for this serializer. It the serializer has already been associated with an output format, it will switch to the new format. This method should not be called while the serializer is in the process of serializing a document.

Specified by:
setOutputFormat in interface Serializer
Parameters:
format - The output format to use

startAnchoring

public void startAnchoring(String anchorId)
Description copied from interface: IAnchoringSerializer
Signify that the serializer should begin to append the anchor ID to URLs of its choosing.

Specified by:
startAnchoring in interface IAnchoringSerializer
Parameters:
anchorId - the anchor identifier

stopAnchoring

public void stopAnchoring()
Description copied from interface: IAnchoringSerializer
Signify that anchoring is no longer desired by the serializer.

Specified by:
stopAnchoring in interface IAnchoringSerializer


Copyright © 2010 Jasig. All Rights Reserved.