public abstract class HeaderResponse extends Object implements IHeaderResponse
IHeaderResponse
interface.Constructor and Description |
---|
HeaderResponse() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Mark Header rendering is completed and subsequent usage will be ignored.
|
protected abstract Response |
getRealResponse()
Once the HeaderResponse is closed, no output may be written to it anymore.
|
Response |
getResponse()
Returns the response that can be used to write arbitrary text to the head section.
|
boolean |
isClosed() |
protected void |
markItemRendered(HeaderItem item) |
void |
markRendered(Object object)
Marks the given object as rendered.
|
void |
render(HeaderItem item)
Renders the given
HeaderItem to the response if none of the
tokens of the item has been rendered before. |
protected boolean |
wasItemRendered(HeaderItem item) |
boolean |
wasRendered(Object object)
Returns whether the given object has been marked as rendered.
|
public void markRendered(Object object)
IHeaderResponse
markRendered
in interface IHeaderResponse
object
- object to be marked as rendered.IHeaderResponse.markRendered(java.lang.Object)
public void render(HeaderItem item)
IHeaderResponse
HeaderItem
to the response if none of the
tokens of the item has been rendered before.render
in interface IHeaderResponse
item
- The item to render.protected boolean wasItemRendered(HeaderItem item)
protected void markItemRendered(HeaderItem item)
public boolean wasRendered(Object object)
IHeaderResponse
renderJavaScriptReference
and renderCSSReference
mark
the specified ResourceReference
as rendered.
renderJavaScript
marks List of two elements (first is javascript body
CharSequence and second is id) as rendered.
renderString
marks the whole string as rendered.
markRendered
can be used to mark an arbitrary object as rendered
wasRendered
in interface IHeaderResponse
object
- Object that is queried to be renderedIHeaderResponse.wasRendered(java.lang.Object)
public void close()
IHeaderResponse
close
in interface Closeable
close
in interface AutoCloseable
close
in interface IHeaderResponse
IHeaderResponse.close()
public final Response getResponse()
IHeaderResponse
Note: This method is kind of dangerous as users are able to write to the output whatever they like.
getResponse
in interface IHeaderResponse
IHeaderResponse.getResponse()
public boolean isClosed()
isClosed
in interface IHeaderResponse
IHeaderResponse.isClosed()
protected abstract Response getRealResponse()
getResponse()
is defined final in this class and will return a NullResponse
instance once closed or otherwise the Response provided by this method.Copyright © 2006–2022 Apache Software Foundation. All rights reserved.