- java.lang.Object
-
- java.io.Writer
-
- javax.faces.context.ResponseWriter
-
- javax.faces.context.ResponseWriterWrapper
-
- All Implemented Interfaces:
- Closeable, Flushable, Appendable, AutoCloseable, FacesWrapper<ResponseWriter>
- Direct Known Subclasses:
- PartialResponseWriter
public abstract class ResponseWriterWrapper extends ResponseWriter implements FacesWrapper<ResponseWriter>
Provides a simple implementation of
ResponseWriter
that can be subclassed by developers wishing to provide specialized behavior to an existingResponseWriter
instance. 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
-
-
Field Summary
-
Fields inherited from class java.io.Writer
lock
-
-
Constructor Summary
Constructors Constructor and Description ResponseWriterWrapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description ResponseWriter
cloneWithWriter(Writer writer)
The default behavior of this method is to callResponseWriter.cloneWithWriter(java.io.Writer)
on the wrappedResponseWriter
object.void
close()
The default behavior of this method is to callWriter.close()
on the wrappedResponseWriter
object.void
endCDATA()
The default behavior of this method is to call
ResponseWriter.endCDATA()
on the wrappedResponseWriter
object.void
endDocument()
The default behavior of this method is to callResponseWriter.endDocument()
on the wrappedResponseWriter
object.void
endElement(String name)
The default behavior of this method is to callResponseWriter.endElement(String)
on the wrappedResponseWriter
object.void
flush()
The default behavior of this method is to callResponseWriter.flush()
on the wrappedResponseWriter
object.String
getCharacterEncoding()
The default behavior of this method is to callResponseWriter.getCharacterEncoding()
on the wrappedResponseWriter
object.String
getContentType()
The default behavior of this method is to callResponseWriter.getContentType()
on the wrappedResponseWriter
object.abstract ResponseWriter
getWrapped()
Return the instance that we are wrapping.
void
startCDATA()
The default behavior of this method is to call
ResponseWriter.startCDATA()
on the wrappedResponseWriter
object.void
startDocument()
The default behavior of this method is to callResponseWriter.startDocument()
on the wrappedResponseWriter
object.void
startElement(String name, UIComponent component)
The default behavior of this method is to callResponseWriter.startElement(String, javax.faces.component.UIComponent)
on the wrappedResponseWriter
object.void
write(char[] cbuf, int off, int len)
The default behavior of this method is to callWriter.write(char[], int, int)
on the wrappedResponseWriter
object.void
writeAttribute(String name, Object value, String property)
The default behavior of this method is to callResponseWriter.writeAttribute(String, Object, String)
on the wrappedResponseWriter
object.void
writeComment(Object comment)
The default behavior of this method is to callResponseWriter.writeComment(Object)
on the wrappedResponseWriter
object.void
writeDoctype(String doctype)
The default behavior of this method is to callResponseWriter.writeDoctype(java.lang.String)
on the wrappedResponseWriter
object.void
writePreamble(String preamble)
The default behavior of this method is to callResponseWriter.writePreamble(java.lang.String)
on the wrappedResponseWriter
object.void
writeText(char[] text, int off, int len)
The default behavior of this method is to callResponseWriter.writeText(char[], int, int)
on the wrappedResponseWriter
object.void
writeText(Object text, String property)
The default behavior of this method is to callResponseWriter.writeText(Object, String)
on the wrappedResponseWriter
object.void
writeText(Object text, UIComponent component, String property)
The default behavior of this method is to callResponseWriter.writeText(Object, UIComponent, String)
on the wrappedResponseWriter
object.void
writeURIAttribute(String name, Object value, String property)
The default behavior of this method is to callResponseWriter.writeURIAttribute(String, Object, String)
on the wrappedResponseWriter
object.
-
-
-
Method Detail
-
getWrapped
public abstract ResponseWriter getWrapped()
Return the instance that we are wrapping. As of version 2, this method is public.
- Specified by:
getWrapped
in interfaceFacesWrapper<ResponseWriter>
-
getContentType
public String getContentType()
The default behavior of this method is to call
ResponseWriter.getContentType()
on the wrappedResponseWriter
object.- Specified by:
getContentType
in classResponseWriter
- Since:
- 1.2
- See Also:
ResponseWriter.getContentType()
-
getCharacterEncoding
public String getCharacterEncoding()
The default behavior of this method is to call
ResponseWriter.getCharacterEncoding()
on the wrappedResponseWriter
object.- Specified by:
getCharacterEncoding
in classResponseWriter
- Since:
- 1.2
- See Also:
ResponseWriter.getCharacterEncoding()
-
flush
public void flush() throws IOException
The default behavior of this method is to call
ResponseWriter.flush()
on the wrappedResponseWriter
object.- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classResponseWriter
- Throws:
IOException
- Since:
- 1.2
- See Also:
ResponseWriter.flush()
-
startDocument
public void startDocument() throws IOException
The default behavior of this method is to call
ResponseWriter.startDocument()
on the wrappedResponseWriter
object.- Specified by:
startDocument
in classResponseWriter
- Throws:
IOException
- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.startDocument()
-
endDocument
public void endDocument() throws IOException
The default behavior of this method is to call
ResponseWriter.endDocument()
on the wrappedResponseWriter
object.- Specified by:
endDocument
in classResponseWriter
- Throws:
IOException
- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.endDocument()
-
startElement
public void startElement(String name, UIComponent component) throws IOException
The default behavior of this method is to call
ResponseWriter.startElement(String, javax.faces.component.UIComponent)
on the wrappedResponseWriter
object.- Specified by:
startElement
in 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_BASICRenderKit
specification.- Throws:
IOException
- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.startElement(String, javax.faces.component.UIComponent)
-
startCDATA
public void startCDATA() throws IOException
The default behavior of this method is to call
ResponseWriter.startCDATA()
on the wrappedResponseWriter
object.- Overrides:
startCDATA
in classResponseWriter
- Throws:
IOException
- on any read/write error- Since:
- 2.0
-
endCDATA
public void endCDATA() throws IOException
The default behavior of this method is to call
ResponseWriter.endCDATA()
on the wrappedResponseWriter
object.- Overrides:
endCDATA
in classResponseWriter
- Throws:
IOException
- on any read/write error- Since:
- 2.0
-
endElement
public void endElement(String name) throws IOException
The default behavior of this method is to call
ResponseWriter.endElement(String)
on the wrappedResponseWriter
object.- Specified by:
endElement
in classResponseWriter
- Parameters:
name
- Name of the element to be ended- Throws:
IOException
- on any read/write error- Since:
- 1.2
- See Also:
ResponseWriter.endElement(String)
-
writeAttribute
public void writeAttribute(String name, Object value, String property) throws IOException
The default behavior of this method is to call
ResponseWriter.writeAttribute(String, Object, String)
on the wrappedResponseWriter
object.- Specified by:
writeAttribute
in classResponseWriter
- Parameters:
name
- Attribute name to be addedvalue
- Attribute value to be addedproperty
- Name of the property or attribute (if any) of theUIComponent
associated with the containing element, to which this generated attribute corresponds- Throws:
IOException
- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeAttribute(String, Object, String)
-
writeURIAttribute
public void writeURIAttribute(String name, Object value, String property) throws IOException
The default behavior of this method is to call
ResponseWriter.writeURIAttribute(String, Object, String)
on the wrappedResponseWriter
object.- Specified by:
writeURIAttribute
in classResponseWriter
- Parameters:
name
- Attribute name to be addedvalue
- Attribute value to be addedproperty
- Name of the property or attribute (if any) of theUIComponent
associated with the containing element, to which this generated attribute corresponds- Throws:
IOException
- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeURIAttribute(String, Object, String)
-
writeComment
public void writeComment(Object comment) throws IOException
The default behavior of this method is to call
ResponseWriter.writeComment(Object)
on the wrappedResponseWriter
object.- Specified by:
writeComment
in classResponseWriter
- Parameters:
comment
- Text content of the comment- Throws:
IOException
- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeComment(Object)
-
writeDoctype
public void writeDoctype(String doctype) throws IOException
The default behavior of this method is to call
ResponseWriter.writeDoctype(java.lang.String)
on the wrappedResponseWriter
object.- Overrides:
writeDoctype
in classResponseWriter
- Parameters:
doctype
- Text content of the doctype- Throws:
IOException
- if an input/output error occurs- Since:
- 2.2
- See Also:
ResponseWriter.writeDoctype(java.lang.String)
-
writePreamble
public void writePreamble(String preamble) throws IOException
The default behavior of this method is to call
ResponseWriter.writePreamble(java.lang.String)
on the wrappedResponseWriter
object.- Overrides:
writePreamble
in classResponseWriter
- Parameters:
preamble
- Text content of the preamble- Throws:
IOException
- if an input/output error occurs- Since:
- 2.2
- See Also:
ResponseWriter.writePreamble(java.lang.String)
-
writeText
public void writeText(Object text, String property) throws IOException
The default behavior of this method is to call
ResponseWriter.writeText(Object, String)
on the wrappedResponseWriter
object.- Specified by:
writeText
in classResponseWriter
- Parameters:
text
- Text to be writtenproperty
- Name of the property or attribute (if any) of theUIComponent
associated with the containing element, to which this generated text corresponds- Throws:
IOException
- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeText(Object, String)
-
writeText
public void writeText(Object text, UIComponent component, String property) throws IOException
The default behavior of this method is to call
ResponseWriter.writeText(Object, UIComponent, String)
on the wrappedResponseWriter
object.- Overrides:
writeText
in classResponseWriter
- Parameters:
text
- Text to be writtencomponent
- TheUIComponent
(if any) to which this element correspondsproperty
- Name of the property or attribute (if any) of theUIComponent
associated with the containing element, to which this generated text corresponds- Throws:
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 IOException
The default behavior of this method is to call
ResponseWriter.writeText(char[], int, int)
on the wrappedResponseWriter
object.- Specified by:
writeText
in classResponseWriter
- Parameters:
text
- Text to be writtenoff
- Starting offset (zero-relative)len
- Number of characters to be written- Throws:
IOException
- if an input/output error occurs- Since:
- 1.2
- See Also:
ResponseWriter.writeText(char[], int, int)
-
cloneWithWriter
public ResponseWriter cloneWithWriter(Writer writer)
The default behavior of this method is to call
ResponseWriter.cloneWithWriter(java.io.Writer)
on the wrappedResponseWriter
object.- Specified by:
cloneWithWriter
in classResponseWriter
- Parameters:
writer
- TheWriter
that is the output destination- Since:
- 1.2
- See Also:
ResponseWriter.cloneWithWriter(java.io.Writer)
-
close
public void close() throws IOException
The default behavior of this method is to call
Writer.close()
on the wrappedResponseWriter
object.- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
- Since:
- 1.2
- See Also:
Writer.close()
-
write
public void write(char[] cbuf, int off, int len) throws IOException
The default behavior of this method is to call
Writer.write(char[], int, int)
on the wrappedResponseWriter
object.- Specified by:
write
in classWriter
- Throws:
IOException
- Since:
- 1.2
- See Also:
Writer.write(char[], int, int)
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 17:22:06 Cette version de la page est en cache (à la date du 21/08/2025 17:22:06) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 14/04/2008, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/faces/context/responsewriterwrapper.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.