Top Description Fields Constructors Methods
jakarta.faces.context

public abstract Class ResponseWriterWrapper

extends ResponseWriter
implements FacesWrapper<ResponseWriter>
Class Inheritance
All Implemented Interfaces
jakarta.faces.FacesWrapper
Known Direct Subclasses
jakarta.faces.context.PartialResponseWriter
Imports
java.io.IOException, .Writer, jakarta.faces.FacesWrapper, jakarta.faces.component.UIComponent

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 push the implementation being wrapped to the constructor and use getWrapped to access the instance being wrapped.

Since
1.2

Field Summary

Modifier and TypeField and Description
private ResponseWriter

Constructor Summary

AccessConstructor and Description
public
ResponseWriterWrapper()

Deprecated Use the other constructor taking the implementation being wrapped.
public
ResponseWriterWrapper(ResponseWriter
The implementation being wrapped.
wrapped
)

If this response writer has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor.

Method Summary

Modifier and TypeMethod and Description
public ResponseWriter
cloneWithWriter(Writer
The Writer that is the output destination
writer
)

Implements abstract jakarta.faces.context.ResponseWriter.cloneWithWriter.

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

public void
close()

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

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

public void
endCDATA()

Overrides jakarta.faces.context.ResponseWriter.endCDATA.

The default behavior of this method is to call ResponseWriter#endCDATA on the wrapped ResponseWriter object.

public void
endDocument()

Implements abstract jakarta.faces.context.ResponseWriter.endDocument.

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

public void
endElement(String
Name of the element to be ended
name
)

Implements abstract jakarta.faces.context.ResponseWriter.endElement.

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

public void
flush()

Implements abstract jakarta.faces.context.ResponseWriter.flush.

Implements java.io.Flushable.flush.

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

public String
getCharacterEncoding()

Implements abstract jakarta.faces.context.ResponseWriter.getCharacterEncoding.

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

public String
getContentType()

Implements abstract jakarta.faces.context.ResponseWriter.getContentType.

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

public ResponseWriter
getWrapped()

Implements jakarta.faces.FacesWrapper.getWrapped.

A class that implements this interface uses this method to return an instance of the class being wrapped.

public void
startCDATA()

Overrides jakarta.faces.context.ResponseWriter.startCDATA.

The default behavior of this method is to call ResponseWriter#startCDATA on the wrapped ResponseWriter object.

public void
startDocument()

Implements abstract jakarta.faces.context.ResponseWriter.startDocument.

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

public void
startElement(String
Name of the element to be started
name
,
UIComponent
The UIComponent (if any) to which this element corresponds. This component is inspected for its pass through attributes as described in the standard HTML_BASIC RenderKit specification.
component
)

Implements abstract jakarta.faces.context.ResponseWriter.startElement.

The default behavior of this method is to call ResponseWriter#startElement(String, jakarta.faces.component.UIComponent) on the wrapped ResponseWriter object.

public void
write(char[]
Array of characters
cbuf
,
int
Offset from which to start writing characters
off
,
int
Number of characters to write
len
)

Implements abstract java.io.Writer.write.

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

public void
writeAttribute(String
Attribute name to be added
name
,
Object
Attribute value to be added
value
,
String
Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated attribute corresponds
property
)

Implements abstract jakarta.faces.context.ResponseWriter.writeAttribute.

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

public void
writeComment(Object
Text content of the comment
comment
)

Implements abstract jakarta.faces.context.ResponseWriter.writeComment.

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

public void
writeDoctype(String
Text content of the doctype
doctype
)

Overrides jakarta.faces.context.ResponseWriter.writeDoctype.

The default behavior of this method is to call ResponseWriter#writeDoctype on the wrapped ResponseWriter object.

public void
writePreamble(String
Text content of the preamble
preamble
)

Overrides jakarta.faces.context.ResponseWriter.writePreamble.

The default behavior of this method is to call ResponseWriter#writePreamble on the wrapped ResponseWriter object.

public void
writeText(Object
Text to be written
text
,
String
Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated text corresponds
property
)

Implements abstract jakarta.faces.context.ResponseWriter.writeText.

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

public void
writeText(Object
Text to be written
text
,
UIComponent
The UIComponent (if any) to which this element corresponds
component
,
String
Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated text corresponds
property
)

Overrides jakarta.faces.context.ResponseWriter.writeText.

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

public void
writeText(char[]
Text to be written
text
,
int
Starting offset (zero-relative)
off
,
int
Number of characters to be written
len
)

Implements abstract jakarta.faces.context.ResponseWriter.writeText.

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

public void
writeURIAttribute(String
Attribute name to be added
name
,
Object
Attribute value to be added
value
,
String
Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated attribute corresponds
property
)

Implements abstract jakarta.faces.context.ResponseWriter.writeURIAttribute.

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

Field Detail

wrappedback to summary
private ResponseWriter wrapped

Constructor Detail

ResponseWriterWrapperback to summary
public ResponseWriterWrapper()

Deprecated

Use the other constructor taking the implementation being wrapped.

Annotations
@Deprecated
ResponseWriterWrapperback to summary
public ResponseWriterWrapper(ResponseWriter wrapped)

If this response writer has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The getWrapped() will then return the implementation being wrapped.

Parameters
wrapped:ResponseWriter

The implementation being wrapped.

Since
2.3

Method Detail

cloneWithWriterback to summary
public ResponseWriter cloneWithWriter(Writer writer)

Implements abstract jakarta.faces.context.ResponseWriter.cloneWithWriter.

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

Parameters
writer:Writer

Doc from jakarta.faces.context.ResponseWriter.cloneWithWriter.

The Writer that is the output destination

Returns:ResponseWriter

Doc from jakarta.faces.context.ResponseWriter.cloneWithWriter.

the new ResponseWriter

Annotations
@Override
Since
1.2
See Also
ResponseWriter#cloneWithWriter(java.io.Writer)
closeback to summary
public void close() throws IOException

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

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

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Writer.close.

If an I/O error occurs

Since
1.2
See Also
ResponseWriter#close()
endCDATAback to summary
public void endCDATA() throws IOException

Overrides jakarta.faces.context.ResponseWriter.endCDATA.

The default behavior of this method is to call ResponseWriter#endCDATA on the wrapped ResponseWriter object.

Annotations
@Override
Exceptions
IOException:
on any read/write error
Since
2.0
endDocumentback to summary
public void endDocument() throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.endDocument.

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

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.endDocument.

if an input/output error occurs

Since
1.2
See Also
ResponseWriter#endDocument()
endElementback to summary
public void endElement(String name) throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.endElement.

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

Parameters
name:String

Doc from jakarta.faces.context.ResponseWriter.endElement.

Name of the element to be ended

Annotations
@Override
Exceptions
IOException:
on any read/write error
Since
1.2
See Also
ResponseWriter#endElement(String)
flushback to summary
public void flush() throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.flush.

Implements java.io.Flushable.flush.

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

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Writer.flush.

If an I/O error occurs

Since
1.2
See Also
ResponseWriter#flush()
getCharacterEncodingback to summary
public String getCharacterEncoding()

Implements abstract jakarta.faces.context.ResponseWriter.getCharacterEncoding.

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

Returns:String

Doc from jakarta.faces.context.ResponseWriter.getCharacterEncoding.

the character encoding

Annotations
@Override
Since
1.2
See Also
ResponseWriter#getCharacterEncoding()
getContentTypeback to summary
public String getContentType()

Implements abstract jakarta.faces.context.ResponseWriter.getContentType.

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

Returns:String

Doc from jakarta.faces.context.ResponseWriter.getContentType.

the content type

Annotations
@Override
Since
1.2
See Also
ResponseWriter#getContentType()
getWrappedback to summary
public ResponseWriter getWrapped()

Implements jakarta.faces.FacesWrapper.getWrapped.

Doc from jakarta.faces.FacesWrapper.getWrapped.

A class that implements this interface uses this method to return an instance of the class being wrapped.

Returns:ResponseWriter

the wrapped instance.

Annotations
@Override
startCDATAback to summary
public void startCDATA() throws IOException

Overrides jakarta.faces.context.ResponseWriter.startCDATA.

The default behavior of this method is to call ResponseWriter#startCDATA on the wrapped ResponseWriter object.

Annotations
@Override
Exceptions
IOException:
on any read/write error
Since
2.0
startDocumentback to summary
public void startDocument() throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.startDocument.

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

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.startDocument.

if an input/output error occurs

Since
1.2
See Also
ResponseWriter#startDocument()
startElementback to summary
public void startElement(String name, UIComponent component) throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.startElement.

The default behavior of this method is to call ResponseWriter#startElement(String, jakarta.faces.component.UIComponent) on the wrapped ResponseWriter object.

Parameters
name:String

Doc from jakarta.faces.context.ResponseWriter.startElement.

Name of the element to be started

component:UIComponent

Doc from jakarta.faces.context.ResponseWriter.startElement.

The UIComponent (if any) to which this element corresponds. This component is inspected for its pass through attributes as described in the standard HTML_BASIC RenderKit specification.

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.startElement.

if an input/output error occurs

Since
1.2
See Also
ResponseWriter#startElement(String, jakarta.faces.component.UIComponent)
writeback to summary
public void write(char[] cbuf, int off, int len) throws IOException

Implements abstract java.io.Writer.write.

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

Parameters
cbuf:char[]

Doc from java.io.Writer.write.

Array of characters

off:int

Doc from java.io.Writer.write.

Offset from which to start writing characters

len:int

Doc from java.io.Writer.write.

Number of characters to write

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Writer.write.

If an I/O error occurs

Since
1.2
See Also
ResponseWriter#write(char[], int, int)
writeAttributeback to summary
public void writeAttribute(String name, Object value, String property) throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.writeAttribute.

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

Parameters
name:String

Doc from jakarta.faces.context.ResponseWriter.writeAttribute.

Attribute name to be added

value:Object

Doc from jakarta.faces.context.ResponseWriter.writeAttribute.

Attribute value to be added

property:String

Doc from jakarta.faces.context.ResponseWriter.writeAttribute.

Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated attribute corresponds

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.writeAttribute.

if an input/output error occurs

Since
1.2
See Also
ResponseWriter#writeAttribute(String, Object, String)
writeCommentback to summary
public void writeComment(Object comment) throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.writeComment.

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

Parameters
comment:Object

Doc from jakarta.faces.context.ResponseWriter.writeComment.

Text content of the comment

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.writeComment.

if an input/output error occurs

Since
1.2
See Also
ResponseWriter#writeComment(Object)
writeDoctypeback to summary
public void writeDoctype(String doctype) throws IOException

Overrides jakarta.faces.context.ResponseWriter.writeDoctype.

The default behavior of this method is to call ResponseWriter#writeDoctype on the wrapped ResponseWriter object.

Parameters
doctype:String

Doc from jakarta.faces.context.ResponseWriter.writeDoctype.

Text content of the doctype

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.writeDoctype.

if an input/output error occurs

Since
2.2
See Also
ResponseWriter#writeDoctype
writePreambleback to summary
public void writePreamble(String preamble) throws IOException

Overrides jakarta.faces.context.ResponseWriter.writePreamble.

The default behavior of this method is to call ResponseWriter#writePreamble on the wrapped ResponseWriter object.

Parameters
preamble:String

Doc from jakarta.faces.context.ResponseWriter.writePreamble.

Text content of the preamble

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.writePreamble.

if an input/output error occurs

Since
2.2
See Also
ResponseWriter#writePreamble
writeTextback to summary
public void writeText(Object text, String property) throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.writeText.

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

Parameters
text:Object

Doc from jakarta.faces.context.ResponseWriter.writeText.

Text to be written

property:String

Doc from jakarta.faces.context.ResponseWriter.writeText.

Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated text corresponds

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.writeText.

if an input/output error occurs

Since
1.2
See Also
ResponseWriter#writeText(Object, String)
writeTextback to summary
public void writeText(Object text, UIComponent component, String property) throws IOException

Overrides jakarta.faces.context.ResponseWriter.writeText.

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

Parameters
text:Object

Doc from jakarta.faces.context.ResponseWriter.writeText.

Text to be written

component:UIComponent

Doc from jakarta.faces.context.ResponseWriter.writeText.

The UIComponent (if any) to which this element corresponds

property:String

Doc from jakarta.faces.context.ResponseWriter.writeText.

Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated text corresponds

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.writeText.

if an input/output error occurs

Since
1.2
See Also
ResponseWriter#writeText(Object, String)
writeTextback to summary
public void writeText(char[] text, int off, int len) throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.writeText.

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

Parameters
text:char[]

Doc from jakarta.faces.context.ResponseWriter.writeText.

Text to be written

off:int

Doc from jakarta.faces.context.ResponseWriter.writeText.

Starting offset (zero-relative)

len:int

Doc from jakarta.faces.context.ResponseWriter.writeText.

Number of characters to be written

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.writeText.

if an input/output error occurs

Since
1.2
See Also
ResponseWriter#writeText(char[], int, int)
writeURIAttributeback to summary
public void writeURIAttribute(String name, Object value, String property) throws IOException

Implements abstract jakarta.faces.context.ResponseWriter.writeURIAttribute.

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

Parameters
name:String

Doc from jakarta.faces.context.ResponseWriter.writeURIAttribute.

Attribute name to be added

value:Object

Doc from jakarta.faces.context.ResponseWriter.writeURIAttribute.

Attribute value to be added

property:String

Doc from jakarta.faces.context.ResponseWriter.writeURIAttribute.

Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated attribute corresponds

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.context.ResponseWriter.writeURIAttribute.

if an input/output error occurs

Since
1.2
See Also
ResponseWriter#writeURIAttribute(String, Object, String)