Class ResponseWriterWrapper
- java.lang.Object
-
- java.io.Writer
-
- javax.faces.context.ResponseWriter
-
- javax.faces.context.ResponseWriterWrapper
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.Appendable,java.lang.AutoCloseable,FacesWrapper<ResponseWriter>
- Direct Known Subclasses:
PartialResponseWriter
public abstract class ResponseWriterWrapper extends ResponseWriter implements FacesWrapper<ResponseWriter>
Provides a simple implementation of
ResponseWriterthat can be subclassed by developers wishing to provide specialized behavior to an existingResponseWriterinstance. The default implementation of all methods is to call through to the wrappedResponseWriter.Usage: extend this class and override
getWrapped()to return the instance we are wrapping.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description ResponseWriterWrapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ResponseWritercloneWithWriter(java.io.Writer writer)The default behavior of this method is to callResponseWriter.cloneWithWriter(java.io.Writer)on the wrappedResponseWriterobject.voidclose()The default behavior of this method is to callWriter.close()on the wrappedResponseWriterobject.voidendCDATA()The default behavior of this method is to callResponseWriter.endCDATA()on the wrappedResponseWriterobject.voidendDocument()The default behavior of this method is to callResponseWriter.endDocument()on the wrappedResponseWriterobject.voidendElement(java.lang.String name)The default behavior of this method is to callResponseWriter.endElement(String)on the wrappedResponseWriterobject.voidflush()The default behavior of this method is to callResponseWriter.flush()on the wrappedResponseWriterobject.java.lang.StringgetCharacterEncoding()The default behavior of this method is to callResponseWriter.getCharacterEncoding()on the wrappedResponseWriterobject.java.lang.StringgetContentType()The default behavior of this method is to callResponseWriter.getContentType()on the wrappedResponseWriterobject.abstract ResponseWritergetWrapped()Return the instance that we are wrapping.voidstartCDATA()The default behavior of this method is to callResponseWriter.startCDATA()on the wrappedResponseWriterobject.voidstartDocument()The default behavior of this method is to callResponseWriter.startDocument()on the wrappedResponseWriterobject.voidstartElement(java.lang.String name, UIComponent component)The default behavior of this method is to callResponseWriter.startElement(String, javax.faces.component.UIComponent)on the wrappedResponseWriterobject.voidwrite(char[] cbuf, int off, int len)The default behavior of this method is to callWriter.write(char[], int, int)on the wrappedResponseWriterobject.voidwriteAttribute(java.lang.String name, java.lang.Object value, java.lang.String property)The default behavior of this method is to callResponseWriter.writeAttribute(String, Object, String)on the wrappedResponseWriterobject.voidwriteComment(java.lang.Object comment)The default behavior of this method is to callResponseWriter.writeComment(Object)on the wrappedResponseWriterobject.voidwriteDoctype(java.lang.String doctype)The default behavior of this method is to callResponseWriter.writeDoctype(java.lang.String)on the wrappedResponseWriterobject.voidwritePreamble(java.lang.String preamble)The default behavior of this method is to callResponseWriter.writePreamble(java.lang.String)on the wrappedResponseWriterobject.voidwriteText(char[] text, int off, int len)The default behavior of this method is to callResponseWriter.writeText(char[], int, int)on the wrappedResponseWriterobject.voidwriteText(java.lang.Object text, java.lang.String property)The default behavior of this method is to callResponseWriter.writeText(Object, String)on the wrappedResponseWriterobject.voidwriteText(java.lang.Object text, UIComponent component, java.lang.String property)The default behavior of this method is to callResponseWriter.writeText(Object, UIComponent, String)on the wrappedResponseWriterobject.voidwriteURIAttribute(java.lang.String name, java.lang.Object value, java.lang.String property)The default behavior of this method is to callResponseWriter.writeURIAttribute(String, Object, String)on the wrappedResponseWriterobject.
-
-
-
Method Detail
-
getWrapped
public abstract ResponseWriter getWrapped()
Return the instance that we are wrapping. As of version 2, this method is public.
- Specified by:
getWrappedin interfaceFacesWrapper<ResponseWriter>
-
getContentType
public java.lang.String getContentType()
The default behavior of this method is to call
ResponseWriter.getContentType()on the wrappedResponseWriterobject.- Specified by:
getContentTypein classResponseWriter- Since:
- 1.2
- See Also:
ResponseWriter.getContentType()
-
getCharacterEncoding
public java.lang.String getCharacterEncoding()
The default behavior of this method is to call
ResponseWriter.getCharacterEncoding()on the wrappedResponseWriterobject.- Specified by:
getCharacterEncodingin classResponseWriter- Since:
- 1.2
- See Also:
ResponseWriter.getCharacterEncoding()
-
flush
public void flush() throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.flush()on the wrappedResponseWriterobject.- Specified by:
flushin interfacejava.io.Flushable- Specified by:
flushin classResponseWriter- Throws:
java.io.IOException- Since:
- 1.2
- See Also:
ResponseWriter.flush()
-
startDocument
public void startDocument() throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.startDocument()on the wrappedResponseWriterobject.- Specified by:
startDocumentin classResponseWriter- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.startDocument()
-
endDocument
public void endDocument() throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.endDocument()on the wrappedResponseWriterobject.- Specified by:
endDocumentin classResponseWriter- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.endDocument()
-
startElement
public void startElement(java.lang.String name, UIComponent component) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.startElement(String, javax.faces.component.UIComponent)on the wrappedResponseWriterobject.- Specified by:
startElementin classResponseWriter- Parameters:
name- Name of the element to be startedcomponent- TheUIComponent(if any) to which this element corresponds. This component is inspected for its pass through attributes as described in the standard HTML_BASICRenderKitspecification.- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.startElement(String, javax.faces.component.UIComponent)
-
startCDATA
public void startCDATA() throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.startCDATA()on the wrappedResponseWriterobject.- Overrides:
startCDATAin classResponseWriter- Throws:
java.io.IOException- on any read/write error- Since:
- 2.0
-
endCDATA
public void endCDATA() throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.endCDATA()on the wrappedResponseWriterobject.- Overrides:
endCDATAin classResponseWriter- Throws:
java.io.IOException- on any read/write error- Since:
- 2.0
-
endElement
public void endElement(java.lang.String name) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.endElement(String)on the wrappedResponseWriterobject.- Specified by:
endElementin classResponseWriter- Parameters:
name- Name of the element to be ended- Throws:
java.io.IOException- on any read/write error- Since:
- 1.2
- See Also:
ResponseWriter.endElement(String)
-
writeAttribute
public void writeAttribute(java.lang.String name, java.lang.Object value, java.lang.String property) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.writeAttribute(String, Object, String)on the wrappedResponseWriterobject.- Specified by:
writeAttributein classResponseWriter- Parameters:
name- Attribute name to be addedvalue- Attribute value to be addedproperty- Name of the property or attribute (if any) of theUIComponentassociated with the containing element, to which this generated attribute corresponds- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeAttribute(String, Object, String)
-
writeURIAttribute
public void writeURIAttribute(java.lang.String name, java.lang.Object value, java.lang.String property) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.writeURIAttribute(String, Object, String)on the wrappedResponseWriterobject.- Specified by:
writeURIAttributein classResponseWriter- Parameters:
name- Attribute name to be addedvalue- Attribute value to be addedproperty- Name of the property or attribute (if any) of theUIComponentassociated with the containing element, to which this generated attribute corresponds- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeURIAttribute(String, Object, String)
-
writeComment
public void writeComment(java.lang.Object comment) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.writeComment(Object)on the wrappedResponseWriterobject.- Specified by:
writeCommentin classResponseWriter- Parameters:
comment- Text content of the comment- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeComment(Object)
-
writeDoctype
public void writeDoctype(java.lang.String doctype) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.writeDoctype(java.lang.String)on the wrappedResponseWriterobject.- Overrides:
writeDoctypein classResponseWriter- Parameters:
doctype- Text content of the doctype- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 2.2
- See Also:
ResponseWriter.writeDoctype(java.lang.String)
-
writePreamble
public void writePreamble(java.lang.String preamble) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.writePreamble(java.lang.String)on the wrappedResponseWriterobject.- Overrides:
writePreamblein classResponseWriter- Parameters:
preamble- Text content of the preamble- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 2.2
- See Also:
ResponseWriter.writePreamble(java.lang.String)
-
writeText
public void writeText(java.lang.Object text, java.lang.String property) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.writeText(Object, String)on the wrappedResponseWriterobject.- Specified by:
writeTextin classResponseWriter- Parameters:
text- Text to be writtenproperty- Name of the property or attribute (if any) of theUIComponentassociated with the containing element, to which this generated text corresponds- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeText(Object, String)
-
writeText
public void writeText(java.lang.Object text, UIComponent component, java.lang.String property) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.writeText(Object, UIComponent, String)on the wrappedResponseWriterobject.- Overrides:
writeTextin classResponseWriter- Parameters:
text- Text to be writtencomponent- TheUIComponent(if any) to which this element correspondsproperty- Name of the property or attribute (if any) of theUIComponentassociated with the containing element, to which this generated text corresponds- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeText(Object, String)
-
writeText
public void writeText(char[] text, int off, int len) throws java.io.IOExceptionThe default behavior of this method is to call
ResponseWriter.writeText(char[], int, int)on the wrappedResponseWriterobject.- Specified by:
writeTextin classResponseWriter- Parameters:
text- Text to be writtenoff- Starting offset (zero-relative)len- Number of characters to be written- Throws:
java.io.IOException- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeText(char[], int, int)
-
cloneWithWriter
public ResponseWriter cloneWithWriter(java.io.Writer writer)
The default behavior of this method is to call
ResponseWriter.cloneWithWriter(java.io.Writer)on the wrappedResponseWriterobject.- Specified by:
cloneWithWriterin classResponseWriter- Parameters:
writer- TheWriterthat is the output destination- Since:
- 1.2
- See Also:
ResponseWriter.cloneWithWriter(java.io.Writer)
-
close
public void close() throws java.io.IOExceptionThe default behavior of this method is to call
Writer.close()on the wrappedResponseWriterobject.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classjava.io.Writer- Throws:
java.io.IOException- Since:
- 1.2
- See Also:
Writer.close()
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOExceptionThe default behavior of this method is to call
Writer.write(char[], int, int)on the wrappedResponseWriterobject.- Specified by:
writein classjava.io.Writer- Throws:
java.io.IOException- Since:
- 1.2
- See Also:
Writer.write(char[], int, int)
-
-