| java.lang.Object uk.org.ponder.rsf.viewstate.ViewParameters
All known Subclasses: uk.org.ponder.rsf.viewstate.SimpleViewParameters, uk.org.ponder.rsf.viewstate.EntityCentredViewParameters,
ViewParameters | abstract public class ViewParameters implements AnyViewParameters(Code) | | An RSF ViewParameters is a rule for extracting the relevant fields from a URL
(or similar spec) that specify the content of a view and representing them in
a typesafe way as an object. Users will more frequently extend the more
convenient class
SimpleViewParameters . The actual work of parsing is
done by the more stateful bean ViewParametersParser.
Every ViewParameters class must be default-constructible.
The base class abstracting common functionality for specifying a view state
of a web application, independent of any particular application or url
mapping technology. In order to get generate a complete external URL, you
must use one of the methods of
uk.org.ponder.rsf.viewstate.ViewStateHandler .
author: Antranig Basman (antranig@caret.cam.ac.uk) |
Field Summary | |
final public static String | BASE_PARSE_SPEC | final public static String | TRUNK_PARSE_PREFIX The special prefix which is used in
ViewParameters.getParseSpec() to represent
a part of URL state which will be placed in the URL trunk rather than
an attribute. | final public static String[] | cloneexceptions "Ephemeral" fields of ViewParameters state that will not propagate by
default. | public String | debugrender This field is set indicating that this view will be rendered in
"debug mode" - full RSF IDs will be allocated to every rendered element,
and omitted elements will be highlighted in place. | public String | endflow This field is set indicating that this view is a "terminal flow view",
representing the summary to the user of a multi-request state (flow). | public String | errorredirect This field is set indicating that this view is a redirect from a level-1
rendering error. | public String | errortoken This field is set in the case of an error arising from user-submitted data,
in which case the data is being returned for correction. | public String | flowtoken The following public fields define RSF housekeeping information, and should
not generally be read or written by user code.
A globally unique key identifying view-specific state that is held on the
server, restorable in the form of a request-scope bean container. | public String | viewID The primary key identifying this view - this is generally used as a key not
only to view templates, component producers, but also into flow states. |
BASE_PARSE_SPEC | final public static String BASE_PARSE_SPEC(Code) | | |
TRUNK_PARSE_PREFIX | final public static String TRUNK_PARSE_PREFIX(Code) | | The special prefix which is used in
ViewParameters.getParseSpec() to represent
a part of URL state which will be placed in the URL trunk rather than
an attribute. For example, the {
ViewParameters.viewID itself is commonly mapped
to @0 indicating it is the first path segment in the "pathInfo"
section of the URL.
|
cloneexceptions | final public static String[] cloneexceptions(Code) | | "Ephemeral" fields of ViewParameters state that will not propagate by
default.
|
debugrender | public String debugrender(Code) | | This field is set indicating that this view will be rendered in
"debug mode" - full RSF IDs will be allocated to every rendered element,
and omitted elements will be highlighted in place.
|
endflow | public String endflow(Code) | | This field is set indicating that this view is a "terminal flow view",
representing the summary to the user of a multi-request state (flow). Some,
none or all of the request state accumulated during the flow may be
available to render this view, most likely in a more rapidly-expiring cache
(default is to use the same TokenStateHolder as the error state). It is
only valid to set this field if flowtoken is also set.
|
errorredirect | public String errorredirect(Code) | | This field is set indicating that this view is a redirect from a level-1
rendering error. Any further errors will be treated as fatal, to avoid a
redirect loop. Usually not set.
|
errortoken | public String errortoken(Code) | | This field is set in the case of an error arising from user-submitted data,
in which case the data is being returned for correction. Not generally set.
|
flowtoken | public String flowtoken(Code) | | The following public fields define RSF housekeeping information, and should
not generally be read or written by user code.
A globally unique key identifying view-specific state that is held on the
server, restorable in the form of a request-scope bean container. Need not
be set.
|
viewID | public String viewID(Code) | | The primary key identifying this view - this is generally used as a key not
only to view templates, component producers, but also into flow states.
This field is always set.
|
copyBase | public ViewParameters copyBase()(Code) | | See
ViewParameters.copyBase(DeepBeanCloner) below. Uses a ThreadLocal call to
acquire the standard DeepBeanCloner bound to the current thread - necessary
since ViewParameters objects are cloned in all sorts of lightweight
contexts. Use the method below by preference if at all possible.
|
copyBase | public ViewParameters copyBase(DeepBeanCloner cloner)(Code) | | Make a "deep clone" of this ViewParameters object, representing the "same"
view state but sharing no Object state with this object. To enable this to
work automatically, all extra members from derived classes must be POJO
beans or peas. See
DeepBeanCloner for explanation of the algorithm
used. Use this method if the performance or architecture impact of the
no-args method bothers you.
|
getAnchorField | public String getAnchorField()(Code) | | Return a field which will be used to form the "anchor" text in the URL
state - in HTTP, this typically follows the URL body with a #
character.
|
getParseSpec | abstract public String getParseSpec()(Code) | | Returns a "parse specification" suitable for mapping this ViewParameters
onto a URL.
This is a comma-separated list of field specifications. Each field specification
takes the form of the name of an URL attribute, optionally followed by the
colon character : and an EL path into this ViewParameters object onto which
the attribute should be mapped. Instead of a URL attribute, URL pathinfo
segments can be specified by providing strings of the form @0 ,
@1 , etc.
If users derive from
SimpleViewParameters and do not override this method, a default
parse specification will be inferred which maps all defined properties
onto similarly-named URL attributes.
A string representing a URL parse specification |
|
|