Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * $Id: ResponseWriterWrapper.java,v 1.5 2006/03/24 19:20:44 edburns Exp $
   */
  
  /*
   * The contents of this file are subject to the terms
   * of the Common Development and Distribution License
   * (the License). You may not use this file except in
   * compliance with the License.
  * 
  * You can obtain a copy of the License at
  * https://javaserverfaces.dev.java.net/CDDL.html or
  * legal/CDDLv1.0.txt. 
  * See the License for the specific language governing
  * permission and limitations under the License.
  * 
  * When distributing Covered Code, include this CDDL
  * Header Notice in each file and include the License file
  * at legal/CDDLv1.0.txt.    
  * If applicable, add the following below the CDDL Header,
  * with the fields enclosed by brackets [] replaced by
  * your own identifying information:
  * "Portions Copyrighted [year] [name of copyright owner]"
  * 
  * [Name of File] [ver.__] [Date]
  * 
  * Copyright 2005 Sun Microsystems Inc. All Rights Reserved
  */
 
 package javax.faces.context;
 
 
 import java.io.Writer;

Provides a simple implementation of ResponseWriter that can be subclassed by developers wishing to provide specialized behavior to an existing ResponseWriter instance. The default implementation of all methods is to call through to the wrapped ResponseWriter.

Usage: extend this class and override getWrapped() to return the instance we are wrapping.

Since:
1.2
 
 public abstract class ResponseWriterWrapper extends ResponseWriter {


    

Returns:
the instance that we are wrapping.
  
 
     abstract protected ResponseWriter getWrapped();
 
     // -------------------------- Methods from javax.faces.contxt.ResponseWriter
 

    

The default behavior of this method is to call ResponseWriter.getContentType() on the wrapped ResponseWriter object.

 
     public String getContentType() {
 
         return getWrapped().getContentType();
 
     }


    

The default behavior of this method is to call ResponseWriter.getCharacterEncoding() on the wrapped ResponseWriter object.

 
     public String getCharacterEncoding() {
 
         return getWrapped().getCharacterEncoding();
 
     }


    

The default behavior of this method is to call ResponseWriter.flush() on the wrapped ResponseWriter object.

Since:
1.2
See also:
ResponseWriter.flush()
 
     public void flush() throws IOException {
        getWrapped().flush();
    }


    

The default behavior of this method is to call ResponseWriter.startDocument() on the wrapped ResponseWriter object.

Since:
1.2
See also:
ResponseWriter.startDocument()
    public void startDocument() throws IOException {
        getWrapped().startDocument();
    }


    

The default behavior of this method is to call ResponseWriter.endDocument() on the wrapped ResponseWriter object.

Since:
1.2
See also:
ResponseWriter.endDocument()
    public void endDocument() throws IOException {
        getWrapped().endDocument();
    }


    
    public void startElement(String nameUIComponent component)
    throws IOException {
        getWrapped().startElement(namecomponent);
    }


    

The default behavior of this method is to call ResponseWriter.endElement(java.lang.String) on the wrapped ResponseWriter object.

    public void endElement(String namethrows IOException {
        getWrapped().endElement(name);
    }


    
    public void writeAttribute(String nameObject valueString property)
        throws IOException {
        getWrapped().writeAttribute(namevalueproperty);
    }


    
    public void writeURIAttribute(String nameObject valueString property)
        throws IOException {
        getWrapped().writeURIAttribute(namevalueproperty);
    }


    

The default behavior of this method is to call ResponseWriter.writeComment(java.lang.Object) on the wrapped ResponseWriter object.

    public void writeComment(Object commentthrows IOException {
        getWrapped().writeComment(comment);
    }


    

The default behavior of this method is to call ResponseWriter.writeText(java.lang.Object,java.lang.String) on the wrapped ResponseWriter object.

    public void writeText(Object textString propertythrows IOException {
        getWrapped().writeText(textproperty);
    }

    
    public void writeText(Object textUIComponent componentString property)
        throws IOException {
	getWrapped().writeText(textcomponentproperty);
    }



    

The default behavior of this method is to call ResponseWriter.writeText(char[],int,int) on the wrapped ResponseWriter object.

    public void writeText(char[] textint offint lenthrows IOException {
        getWrapped().writeText(textofflen);
    }


    

The default behavior of this method is to call ResponseWriter.cloneWithWriter(java.io.Writer) on the wrapped ResponseWriter object.

    public ResponseWriter cloneWithWriter(Writer writer) {
        return getWrapped().cloneWithWriter(writer);
    }
    // --------------------------------------------- Methods from java.io.Writer


    

The default behavior of this method is to call java.io.Writer.close() on the wrapped ResponseWriter object.

Since:
1.2
See also:
java.io.Writer.close()
    public void close() throws IOException {
        getWrapped().close();
    }


    

The default behavior of this method is to call java.io.Writer.write(char[],int,int) on the wrapped ResponseWriter object.

    public void write(char[] cbufint offint lenthrows IOException {
        getWrapped().write(cbufofflen);
    }
New to GrepCode? Check out our FAQ X