Package com.webmethods.caf.faces.render
Class LimitedElementsResponseWriter
java.lang.Object
java.io.Writer
javax.faces.context.ResponseWriter
javax.faces.context.ResponseWriterWrapper
com.webmethods.caf.faces.render.LimitedElementsResponseWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
,FacesWrapper<ResponseWriter>
ResponseWriter which eats any element and its content if the element is in the blacklist,
or if a whitelist has been specified, and the element is not in the whitelist.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLimitedElementsResponseWriter
(ResponseWriter wrapped, Set<String> whitelistElements) LimitedElementsResponseWriter
(ResponseWriter wrapped, Set<String> whitelistElements, Set<String> whitelistAttributes) -
Method Summary
Modifier and TypeMethodDescriptionappend
(char c) append
(CharSequence csq) append
(CharSequence csq, int start, int end) cloneWithWriter
(Writer writer) void
endElement
(String name) protected boolean
isAttributeAllowed
(String name) Return true if whitelist and blacklist allows specified attribute.protected boolean
isElementAllowed
(String name) Return true if whitelist and blacklist allows specified element.void
setBlacklistAttributes
(Set<String> blacklistAttributes) void
setBlacklistElements
(Set<String> blacklistElements) void
setWhitelistAttributes
(Set<String> whitelistAttributes) void
setWhitelistElements
(Set<String> whitelistElements) void
setWrapped
(ResponseWriter wrapped) void
void
startElement
(String name, UIComponent component) void
write
(char[] cbuf) void
write
(char[] cbuf, int off, int len) void
write
(int c) void
void
void
writeAttribute
(String name, Object value, String property) void
writeComment
(Object comment) void
writeText
(char[] text, int off, int len) void
void
writeURIAttribute
(String name, Object value, String property) Methods inherited from class javax.faces.context.ResponseWriterWrapper
close, endCDATA, endDocument, flush, getCharacterEncoding, getContentType, startCDATA, writeDoctype, writePreamble, writeText
Methods inherited from class java.io.Writer
nullWriter
-
Field Details
-
m_wrapped
-
m_depth
protected int m_depth -
m_whitelistElements
-
m_blacklistElements
-
m_whitelistAttributes
-
m_blacklistAttributes
-
-
Constructor Details
-
LimitedElementsResponseWriter
public LimitedElementsResponseWriter() -
LimitedElementsResponseWriter
-
LimitedElementsResponseWriter
-
LimitedElementsResponseWriter
public LimitedElementsResponseWriter(ResponseWriter wrapped, Set<String> whitelistElements, Set<String> whitelistAttributes)
-
-
Method Details
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classResponseWriterWrapper
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
cloneWithWriter
- Overrides:
cloneWithWriter
in classResponseWriterWrapper
-
endElement
- Overrides:
endElement
in classResponseWriterWrapper
- Throws:
IOException
-
startDocument
- Overrides:
startDocument
in classResponseWriterWrapper
- Throws:
IOException
-
startElement
- Overrides:
startElement
in classResponseWriterWrapper
- Throws:
IOException
-
writeAttribute
- Overrides:
writeAttribute
in classResponseWriterWrapper
- Throws:
IOException
-
writeComment
- Overrides:
writeComment
in classResponseWriterWrapper
- Throws:
IOException
-
writeText
- Overrides:
writeText
in classResponseWriterWrapper
- Throws:
IOException
-
writeText
- Overrides:
writeText
in classResponseWriterWrapper
- Throws:
IOException
-
writeURIAttribute
- Overrides:
writeURIAttribute
in classResponseWriterWrapper
- Throws:
IOException
-
getWrapped
- Specified by:
getWrapped
in interfaceFacesWrapper<ResponseWriter>
- Overrides:
getWrapped
in classResponseWriterWrapper
-
isElementAllowed
Return true if whitelist and blacklist allows specified element. -
isAttributeAllowed
Return true if whitelist and blacklist allows specified attribute. -
setWrapped
-
getWhitelistElements
-
setWhitelistElements
-
getBlacklistElements
-
setBlacklistElements
-
getWhitelistAttributes
-
setWhitelistAttributes
-
getBlacklistAttributes
-
setBlacklistAttributes
-