| java.lang.Object org.mmbase.framework.basic.State
State | public class State (Code) | | State is a wrapper arround HttpServletRequest which maintains the current state of framework
component rendering.
author: Michiel Meeuwissen version: $Id: State.java,v 1.4 2008/02/22 14:05:57 michiel Exp $ since: MMBase-1.9 |
Constructor Summary | |
public | State(ServletRequest r) Use this constructor, if you want to explicitely create a new State object. |
Method Summary | |
public void | end() At the end of the request (or subcomponent), this method must be called, to indicate that
this state is no longer in use. | public void | endBlock() After rendering (a certain renderer of) a block, the state must be informed about that. | protected String | generateId(int c) | public Block | getBlock() The currently rendered block, or null if not rendering. | public int | getDepth() With recursive includes of blocks, it may occur that the state is only for components inside
a certain other component's block. | public Parameters | getFrameworkParameters() Returns the parameters which were used to initialize rendering of the current block. | public String | getId() Returns the id of the current block, which uniquely identifies it on the current page (or
http request). | public Processor | getProcessor() | protected Renderer | getRenderer(Renderer r) Determins what should be rendered now. | public Renderer | getRenderer() | public ServletRequest | getRequest() | public static State | getState(ServletRequest request) Returns the framework 'State' object for the given request.
a State. | public String | getUpcomingId() If rendering not yet started, this returns the id of a component which would begin now. | public Renderer.WindowState | getWindowState() The current window state of rendering. | public boolean | isRendering() Whether something is rendered right now. | protected void | localizeContext() Sets up a LocalizationContext attributes based on
Component.getBundle and puts in on
the request. | protected boolean | needsProcess() | public void | process(Processor proc) | public void | render(Renderer rend) Puts this state in 'render' mode. | public void | setAction(String a) | public void | setBlock(Map<String, Object> map, Block toBlock) | protected void | setType(Renderer.Type t) | public Renderer | startBlock(Parameters frameworkParameters, Renderer renderer) | public String | toString() |
State | public State(ServletRequest r)(Code) | | Use this constructor, if you want to explicitely create a new State object. E.g. when
starting a subcomponent.
state = getState(req);
if (state.isRendering()) {
state = new State(req);
}
But this is only used by code which want to initiate a new component itself. Normally
State.getState(ServletRequest) should suffice.
|
end | public void end()(Code) | | At the end of the request (or subcomponent), this method must be called, to indicate that
this state is no longer in use.
|
endBlock | public void endBlock()(Code) | | After rendering (a certain renderer of) a block, the state must be informed about that.
|
getBlock | public Block getBlock()(Code) | | The currently rendered block, or null if not rendering.
|
getDepth | public int getDepth()(Code) | | With recursive includes of blocks, it may occur that the state is only for components inside
a certain other component's block. In that case the depth > 0.
|
getFrameworkParameters | public Parameters getFrameworkParameters()(Code) | | Returns the parameters which were used to initialize rendering of the current block.
Or null if currently this state is not 'rendering'.
|
getId | public String getId()(Code) | | Returns the id of the current block, which uniquely identifies it on the current page (or
http request).
|
getRenderer | protected Renderer getRenderer(Renderer r)(Code) | | Determins what should be rendered now.
Parameters: block - a proposal |
getState | public static State getState(ServletRequest request)(Code) | | Returns the framework 'State' object for the given request.
a State. Never null . |
getUpcomingId | public String getUpcomingId()(Code) | | If rendering not yet started, this returns the id of a component which would begin now.
|
isRendering | public boolean isRendering()(Code) | | Whether something is rendered right now.
|
localizeContext | protected void localizeContext()(Code) | | Sets up a LocalizationContext attributes based on
Component.getBundle and puts in on
the request. This is recognized by fmt:message-tag, which in a JspRenderer can therefore be
used without fmt:bundle or fmt:setbundle.
|
needsProcess | protected boolean needsProcess()(Code) | | |
process | public void process(Processor proc)(Code) | | Puts this state in 'process' mode
throws: IllegalStateException - If the renderer for block block was already rendered.or when the belonging request was already 'ended'. |
render | public void render(Renderer rend)(Code) | | Puts this state in 'render' mode.
|
startBlock | public Renderer startBlock(Parameters frameworkParameters, Renderer renderer)(Code) | | Whether action must be performed. throws: IllegalStateException - When renderers which should occur 'later' were already rendered,or when the belonging request was already 'ended'. |
|
|