- Direct Known Subclasses:
public abstract class DecoratingHeaderResponse extends Object implements IHeaderResponseThis is simply a helper implementation of IHeaderResponse that really delegates all of its method calls to the IHeaderResponse that is passed into the constructor. It is defined as abstract because it's only meant to be extended and not used a la carte. You can extend it and override only the methods that you want to change the functionality of.
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
close()Mark Header rendering is completed and subsequent usage will be ignored.
getRealResponse()Returns the actual response being decorated for subclasses to be able to pass it off to other objects if they need to do so.
getResponse()Returns the response that can be used to write arbitrary text to the head section.
markRendered(Object object)Marks the given object as rendered.
wasRendered(Object object)Returns whether the given object has been marked as rendered.
protected final IHeaderResponse getRealResponse()
- the actual wrapped IHeaderResponse
public void render(HeaderItem item)Renders the given
HeaderItemto the response if none of its tokens has been rendered before.
Automatically marks all item's tokens as rendered.
public void markRendered(Object object)Marks the given object as rendered. The object can be anything (string, resource reference, etc...). The purpose of this function is to allow user to manually keep track of rendered items. This can be useful for items that are expensive to generate (like interpolated text).
public boolean wasRendered(Object object)Returns whether the given object has been marked as rendered.
public Response getResponse()Returns the response that can be used to write arbitrary text to the head section.
Note: This method is kind of dangerous as users are able to write to the output whatever they like.
public void close()Mark Header rendering is completed and subsequent usage will be ignored. If some kind of buffering is used internally, this action will mark that the contents has to be flushed out.