org.ajax4jsf.io

## Class SAXResponseWriter

- java.lang.Object
- - java.io.Writer
  - - javax.faces.context.ResponseWriter
    - - org.ajax4jsf.io.SAXResponseWriter

- All Implemented Interfaces:
    Closeable, Flushable, Appendable, AutoCloseable

      public class SAXResponseWriter
      extends javax.faces.context.ResponseWriter

  Author:
    shura

    Realization of Faces `ResponseWriter` for Cocoon Environment. Use ONLY Markup-specific calls , send it as SAX events to `XMLConsumer` Use "State" pattern for control of events flow. TODO - implement namespace capabilites

- - ### Field Summary

    - ### Fields inherited from class java.io.Writer

      `lock`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SAXResponseWriter(ContentHandler consumer)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.faces.context.ResponseWriter` | `cloneWithWriter(Writer writer)`
    `void` | `close()`
    `void` | `endDocument()`
    `void` | `endElement(String name)`
    `void` | `flush()`
    `String` | `getCharacterEncoding()`
    `String` | `getContentType()`
    `String` | `getNamespaceURI()`
    `ContentHandler` | `getXmlConsumer()`
    `void` | `setNamespaceURI(String namespaceURI)`
    `void` | `startDocument()`
    `void` | `startElement(String name, javax.faces.component.UIComponent component)`
    `void` | `write(char[] cbuf, int off, int len)`
    `void` | `writeAttribute(String name, Object value, String property)`
    `void` | `writeComment(Object comment)`
    `void` | `writeText(char[] text, int off, int len)`
    `void` | `writeText(Object text, String property)`
    `void` | `writeURIAttribute(String name, Object value, String property)`

    - ### Methods inherited from class javax.faces.context.ResponseWriter

      `endCDATA, startCDATA, writeText`

    - ### Methods inherited from class java.io.Writer

      `append, append, append, write, write, write, write`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SAXResponseWriter

          public SAXResponseWriter(ContentHandler consumer)

      Parameters:
        `consumer` - - SAX events receiver for Cocoon pipeline.

  - ### Method Detail

    - #### getXmlConsumer

          public ContentHandler getXmlConsumer()

    - #### getNamespaceURI

          public String getNamespaceURI()

      Returns:
        Returns the namespaceURI.

    - #### setNamespaceURI

          public void setNamespaceURI(String namespaceURI)

      Parameters:
        `namespaceURI` - The namespaceURI to set.

    - #### getContentType

          public String getContentType()

      Specified by:
        `getContentType` in class `javax.faces.context.ResponseWriter`

    - #### getCharacterEncoding

          public String getCharacterEncoding()

      Specified by:
        `getCharacterEncoding` in class `javax.faces.context.ResponseWriter`

    - #### flush

          public void flush()
                     throws IOException

      Specified by:
        `flush` in interface `Flushable`
      Specified by:
        `flush` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### startDocument

          public void startDocument()
                             throws IOException

      Specified by:
        `startDocument` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### endDocument

          public void endDocument()
                           throws IOException

      Specified by:
        `endDocument` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### startElement

          public void startElement(String name,
                          javax.faces.component.UIComponent component)
                            throws IOException

      Specified by:
        `startElement` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### endElement

          public void endElement(String name)
                          throws IOException

      Specified by:
        `endElement` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### writeAttribute

          public void writeAttribute(String name,
                            Object value,
                            String property)
                              throws IOException

      Specified by:
        `writeAttribute` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### writeURIAttribute

          public void writeURIAttribute(String name,
                               Object value,
                               String property)
                                 throws IOException

      Specified by:
        `writeURIAttribute` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### writeComment

          public void writeComment(Object comment)
                            throws IOException

      Specified by:
        `writeComment` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### writeText

          public void writeText(Object text,
                       String property)
                         throws IOException

      Specified by:
        `writeText` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### writeText

          public void writeText(char[] text,
                       int off,
                       int len)
                         throws IOException

      Specified by:
        `writeText` in class `javax.faces.context.ResponseWriter`
      Throws:
        `IOException`

    - #### cloneWithWriter

          public javax.faces.context.ResponseWriter cloneWithWriter(Writer writer)

      Specified by:
        `cloneWithWriter` in class `javax.faces.context.ResponseWriter`

    - #### write

          public void write(char[] cbuf,
                   int off,
                   int len)
                     throws IOException

      Specified by:
        `write` in class `Writer`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `Writer`
      Throws:
        `IOException`

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.