Class ContentEscape
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.github.bordertech.wcomponents.Escape
-
- com.github.bordertech.wcomponents.ActionEscape
-
- com.github.bordertech.wcomponents.ContentEscape
-
- All Implemented Interfaces:
Serializable
public class ContentEscape extends ActionEscape
An Escape subclass that bypasses the usual request -> paint flow by directly producing the binary document content.- Since:
- 1.0.0
- Author:
- Martin Shevchenko
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContentEscape(ContentAccess contentAccess)Creates a ContentEscape.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidescape()Writes the content to the response.booleanisCacheable()booleanisDisplayInline()Indicates whether the content should be displayed inline or downloaded.voidsetCacheable(boolean cacheable)voidsetDisplayInline(boolean displayInline)Sets whether the content should be displayed inline or downloaded.-
Methods inherited from class com.github.bordertech.wcomponents.Escape
getRequest, getResponse, setRequest, setResponse
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ContentEscape
public ContentEscape(ContentAccess contentAccess)
Creates a ContentEscape.- Parameters:
contentAccess- the ContentAccess which will provide the content.
-
-
Method Detail
-
escape
public void escape() throws IOExceptionWrites the content to the response.- Overrides:
escapein classEscape- Throws:
IOException- if there is an error writing the content.
-
isCacheable
public boolean isCacheable()
- Returns:
- true if content can be cached.
-
setCacheable
public void setCacheable(boolean cacheable)
- Parameters:
cacheable- set true if the content can be cached.
-
isDisplayInline
public boolean isDisplayInline()
Indicates whether the content should be displayed inline or downloaded.- Returns:
- true if the content should be displayed inline, false if it should be downloaded.
-
setDisplayInline
public void setDisplayInline(boolean displayInline)
Sets whether the content should be displayed inline or downloaded.- Parameters:
displayInline- true if the content should be displayed inline, false if it should be downloaded.
-
-