Module org.omnifaces
Class ConditionalResponseWriter
- java.lang.Object
-
- java.io.Writer
-
- jakarta.faces.context.ResponseWriter
-
- jakarta.faces.context.ResponseWriterWrapper
-
- org.omnifaces.component.input.componentidparam.ConditionalResponseWriter
-
- All Implemented Interfaces:
FacesWrapper<ResponseWriter>
,Closeable
,Flushable
,Appendable
,AutoCloseable
public class ConditionalResponseWriter extends ResponseWriterWrapper
ResponseWriter intended to work in conjunction with theComponentIdParam
component.This allows rendering to proceed to the output if the current component matches any of the given ids, otherwise simply does not send anything to the output.
- Since:
- 1.1
- Author:
- Arjan Tijms
-
-
Constructor Summary
Constructors Constructor Description ConditionalResponseWriter(ResponseWriter responseWriter, FacesContext facesContext, List<String> componentIds, List<String> clientIds, boolean renderChildren)
Construct conditional response writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Writer
append(char c)
Writer
append(CharSequence csq)
Writer
append(CharSequence csq, int start, int end)
void
endCDATA()
void
endDocument()
void
endElement(String name)
void
startCDATA()
void
startDocument()
void
startElement(String name, UIComponent component)
void
write(char[] cbuf)
void
write(char[] cbuf, int off, int len)
void
write(int c)
void
write(String str)
void
write(String str, 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, UIComponent component, String property)
void
writeText(Object text, String property)
void
writeURIAttribute(String name, Object value, String property)
-
Methods inherited from class jakarta.faces.context.ResponseWriterWrapper
cloneWithWriter, close, flush, getCharacterEncoding, getContentType, getWrapped, writeDoctype, writePreamble
-
Methods inherited from class java.io.Writer
nullWriter
-
-
-
-
Constructor Detail
-
ConditionalResponseWriter
public ConditionalResponseWriter(ResponseWriter responseWriter, FacesContext facesContext, List<String> componentIds, List<String> clientIds, boolean renderChildren)
Construct conditional response writer.- Parameters:
responseWriter
- Response writer to be wrapped.facesContext
- Involved faces context.componentIds
- Component IDs.clientIds
- Client IDs.renderChildren
- Whether to render children.
-
-
Method Detail
-
endCDATA
public void endCDATA() throws IOException
- Overrides:
endCDATA
in classResponseWriterWrapper
- Throws:
IOException
-
endElement
public void endElement(String name) throws IOException
- Overrides:
endElement
in classResponseWriterWrapper
- Throws:
IOException
-
endDocument
public void endDocument() throws IOException
- Overrides:
endDocument
in classResponseWriterWrapper
- Throws:
IOException
-
startCDATA
public void startCDATA() throws IOException
- Overrides:
startCDATA
in classResponseWriterWrapper
- Throws:
IOException
-
startDocument
public void startDocument() throws IOException
- Overrides:
startDocument
in classResponseWriterWrapper
- Throws:
IOException
-
startElement
public void startElement(String name, UIComponent component) throws IOException
- Overrides:
startElement
in classResponseWriterWrapper
- Throws:
IOException
-
write
public void write(char[] cbuf, int off, int len) throws IOException
- Overrides:
write
in classResponseWriterWrapper
- Throws:
IOException
-
writeAttribute
public void writeAttribute(String name, Object value, String property) throws IOException
- Overrides:
writeAttribute
in classResponseWriterWrapper
- Throws:
IOException
-
writeComment
public void writeComment(Object comment) throws IOException
- Overrides:
writeComment
in classResponseWriterWrapper
- Throws:
IOException
-
writeText
public void writeText(char[] text, int off, int len) throws IOException
- Overrides:
writeText
in classResponseWriterWrapper
- Throws:
IOException
-
writeText
public void writeText(Object text, String property) throws IOException
- Overrides:
writeText
in classResponseWriterWrapper
- Throws:
IOException
-
writeText
public void writeText(Object text, UIComponent component, String property) throws IOException
- Overrides:
writeText
in classResponseWriterWrapper
- Throws:
IOException
-
writeURIAttribute
public void writeURIAttribute(String name, Object value, String property) throws IOException
- Overrides:
writeURIAttribute
in classResponseWriterWrapper
- Throws:
IOException
-
append
public Writer append(char c) throws IOException
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
public Writer append(CharSequence csq) throws IOException
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
public Writer append(CharSequence csq, int start, int end) throws IOException
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
write
public void write(char[] cbuf) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(int c) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(String str) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(String str, int off, int len) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
-