public final class Tapestry extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ABSTRACTPAGE_DETACH_METHOD_ID
Method id used to check that
IPage.detach() is invoked. |
static java.lang.String |
ABSTRACTPAGE_VALIDATE_METHOD_ID
Method id used to check that
IPage.validate(IRequestCycle) is invoked. |
static java.lang.String |
ACTION_SERVICE
The name ("action") of a service that allows behavior to be associated with an
IAction component, such as ActionLink or
Form . |
static java.lang.String |
ASSET_SERVICE
The name ("asset") of a service used to access internal assets.
|
static java.lang.String |
DIRECT_SERVICE
The name ("direct") of a service that allows stateless behavior for an
DirectLink component. |
static java.lang.String |
EXTERNAL_SERVICE
The name ("external") of a service that a allows
IExternalPage to be selected. |
static java.lang.String |
HOME_SERVICE
The name ("home") of a service that jumps to the home page.
|
static java.lang.String |
LINK_COMPONENT_ATTRIBUTE_NAME
The name of an
IRequestCycle attribute in which the currently
rendering ILinkComponent is stored. |
static java.lang.String |
MONITOR_FACTORY_EXTENSION_NAME
Name of an application extension used as a factory for
IMonitor instances. |
static java.lang.String |
MULTIPART_DECODER_EXTENSION_NAME
Name of optional application extension for the multipart decoder used by the application.
|
static java.lang.String |
OGNL_TYPE_CONVERTER
Class name of an
TypeConverter implementing class to use as a type converter for
ExpressionBinding |
static java.lang.String |
PAGE_SERVICE
The name ("page") of a service that allows a new page to be selected.
|
static java.lang.String |
PARAMETER_PROPERTY_NAME_SUFFIX
Suffix appended to a parameter name to form the name of a property that stores the binding
for the parameter.
|
static java.lang.String |
PARAMETERS_QUERY_PARAMETER_NAME
Deprecated.
To be removed in 4.1. Use
ServiceConstants.PARAMETER instead. |
static java.lang.String |
REQUEST_DECODER_EXTENSION_NAME
Key used to obtain an extension from the application specification.
|
static java.lang.String |
RESET_SERVICE
The name ("reset") of a service used to clear cached template and specification data and
remove all pooled pages.
|
static java.lang.String |
RESTART_SERVICE
The name ("restart") of a service that invalidates the session and restarts the application.
|
static java.lang.String |
SERVICE_QUERY_PARAMETER_NAME
Deprecated.
To be removed in 4.1. Use
ServiceConstants.SERVICE instead. |
static java.lang.String |
SIMPLE_PROPERTY_NAME_PATTERN
Regular expression defining a simple property name.
|
static java.lang.String |
TEMPLATE_EXTENSION_PROPERTY
Property name used to get the extension used for templates.
|
static java.lang.String |
VERSION
The version of the framework; this is updated for major releases.
|
Modifier and Type | Method and Description |
---|---|
static void |
addMethodInvocation(java.lang.Object methodId)
Adds a method invocation to the list of invocations.
|
static void |
checkMethodInvocation(java.lang.Object methodId,
java.lang.String methodName,
java.lang.Object object)
Checks to see if a particular method has been invoked.
|
static void |
clearMethodInvocations()
Clears the list of method invocations.
|
static void |
close(java.io.InputStream stream)
Closes the stream (if not null), ignoring any
IOException thrown. |
static java.util.Map |
convertArrayToMap(java.lang.Object[] array)
Converts an even-sized array of objects back into a
Map . |
static java.lang.Object[] |
convertMapToArray(java.util.Map map)
Converts a
Map to an even-sized array of key/value pairs. |
static void |
copyInformalBindings(IComponent source,
IComponent destination)
Copys all informal
bindings from a source component to the destination
component. |
static org.apache.hivemind.ApplicationRuntimeException |
createNoSuchComponentException(IComponent component,
java.lang.String id,
org.apache.hivemind.Location location) |
static BindingException |
createNullBindingException(IBinding binding)
Creates an exception indicating the binding value is null.
|
static org.apache.hivemind.ApplicationRuntimeException |
createRenderOnlyPropertyException(IComponent component,
java.lang.String propertyName) |
static BindingException |
createRequiredParameterException(IComponent component,
java.lang.String parameterName) |
static void |
fireObservedChange(IComponent component,
java.lang.String propertyName,
java.lang.Object newValue)
Method used by pages and components to send notifications about property changes.
|
static java.lang.String |
format(java.lang.String key,
java.lang.Object arg)
Convienience method for invoking
format(String, Object[]) . |
static java.lang.String |
format(java.lang.String key,
java.lang.Object[] args)
Gets a string from the TapestryStrings resource bundle.
|
static java.lang.String |
format(java.lang.String key,
java.lang.Object arg1,
java.lang.Object arg2)
Convienience method for invoking
format(String, Object[]) . |
static java.lang.String |
format(java.lang.String key,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Convienience method for invoking
format(String, Object[]) . |
static java.lang.String |
getClassName(java.lang.Class subject)
Deprecated.
To be removed in 4.1.
|
static java.util.Locale |
getLocale(java.lang.String s)
Gets the
Locale for the given string, which is the result of
Locale.toString() . |
static java.lang.String |
getMessage(java.lang.String key)
Convienience method for invoking
format(String, Object[]) . |
static boolean |
isBlank(java.lang.String input)
Deprecated.
To be removed in Tapestry 4.1. Use
HiveMind.isBlank(java.lang.String)
instead. |
static boolean |
isEmpty(java.util.Collection c)
Returns true if the Collection is null or empty.
|
static boolean |
isEmpty(java.util.Map map)
Returns true if the Map is null or empty.
|
static boolean |
isNonBlank(java.lang.String input)
Deprecated.
To be removed in Tapestry 4.1. Use
HiveMind.isNonBlank(java.lang.String)
instead. |
static int |
size(java.util.Collection c)
Returns the size of a collection, or zero if the collection is null.
|
static int |
size(java.lang.Object[] array)
Returns the length of the array, or 0 if the array is null.
|
public static final java.lang.String ACTION_SERVICE
IAction
component, such as ActionLink
or
Form
.
This service is used with actions that are tied to the dynamic state of the page, and which require a rewind of the page.
public static final java.lang.String DIRECT_SERVICE
DirectLink
component.
This service rolls back the state of the page but doesn't rewind the the dynamic state of the page the was the action service does, which is more efficient but less powerful.
An array of String parameters may be included with the service URL; these will be made
available to the DirectLink
component's listener.
public static final java.lang.String EXTERNAL_SERVICE
IExternalPage
to be selected.
Associated with a ExternalLink
component.
This service enables IExternalPage
s to be accessed via a URL. External pages may be
booked marked using their URL for future reference.
An array of Object parameters may be included with the service URL; these will be passed to
the IExternalPage.activateExternalPage(Object[], IRequestCycle)
method.
public static final java.lang.String PAGE_SERVICE
PageLink
component.
The service requires a single parameter: the name of the target page.
public static final java.lang.String HOME_SERVICE
public static final java.lang.String RESTART_SERVICE
public static final java.lang.String ASSET_SERVICE
public static final java.lang.String RESET_SERVICE
This service is only available if the Java system property
org.apache.tapestry.enable-reset-service
is set to true
.
public static final java.lang.String SERVICE_QUERY_PARAMETER_NAME
ServiceConstants.SERVICE
instead.public static final java.lang.String PARAMETERS_QUERY_PARAMETER_NAME
ServiceConstants.PARAMETER
instead.URLEncoder.encode(String)
before being added to the URL. Multiple values are
handle by repeatedly establishing key/value pairs (this is a change from behavior in 2.1 and
earlier).public static final java.lang.String TEMPLATE_EXTENSION_PROPERTY
public static final java.lang.String LINK_COMPONENT_ATTRIBUTE_NAME
IRequestCycle
attribute in which the currently
rendering ILinkComponent
is stored. Link components do
not nest.public static final java.lang.String PARAMETER_PROPERTY_NAME_SUFFIX
public static final java.lang.String REQUEST_DECODER_EXTENSION_NAME
IRequestDecoder
.public static final java.lang.String MULTIPART_DECODER_EXTENSION_NAME
IMultipartDecoder
(and is
generally a configured instance of
org.apache.tapestry.multipart.DefaultMultipartDecoder
).public static final java.lang.String ABSTRACTPAGE_VALIDATE_METHOD_ID
IPage.validate(IRequestCycle)
is invoked.checkMethodInvocation(Object, String, Object)
,
Constant Field Valuespublic static final java.lang.String ABSTRACTPAGE_DETACH_METHOD_ID
IPage.detach()
is invoked.checkMethodInvocation(Object, String, Object)
,
Constant Field Valuespublic static final java.lang.String SIMPLE_PROPERTY_NAME_PATTERN
public static final java.lang.String MONITOR_FACTORY_EXTENSION_NAME
IMonitor
instances. The extension must implement
IMonitorFactory
.public static final java.lang.String OGNL_TYPE_CONVERTER
TypeConverter
implementing class to use as a type converter for
ExpressionBinding
public static final java.lang.String VERSION
public static void copyInformalBindings(IComponent source, IComponent destination)
bindings
from a source component to the destination
component. Informal bindings are bindings for informal parameters. This will overwrite
parameters (formal or informal) in the destination component if there is a naming conflict.public static java.util.Locale getLocale(java.lang.String s)
Locale
for the given string, which is the result of
Locale.toString()
. If no such locale is already registered, a new instance is
created, registered and returned.public static void close(java.io.InputStream stream)
IOException
thrown.public static java.lang.String format(java.lang.String key, java.lang.Object[] args)
MessageFormat.format(java.lang.String, java.lang.Object[])
.public static java.lang.String getMessage(java.lang.String key)
format(String, Object[])
.public static java.lang.String format(java.lang.String key, java.lang.Object arg)
format(String, Object[])
.public static java.lang.String format(java.lang.String key, java.lang.Object arg1, java.lang.Object arg2)
format(String, Object[])
.public static java.lang.String format(java.lang.String key, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
format(String, Object[])
.public static int size(java.util.Collection c)
public static int size(java.lang.Object[] array)
public static boolean isEmpty(java.util.Map map)
public static boolean isEmpty(java.util.Collection c)
public static java.lang.Object[] convertMapToArray(java.util.Map map)
Map
to an even-sized array of key/value pairs. This may be useful when
using a Map as service parameters (with DirectLink
.
Assuming the keys and values are simple objects (String, Boolean, Integer, etc.), then the
representation as an array will encode more efficiently (via
DataSqueezerImpl
than serializing the Map and its
contents.public static java.util.Map convertArrayToMap(java.lang.Object[] array)
Map
.convertMapToArray(Map)
public static java.lang.String getClassName(java.lang.Class subject)
public static BindingException createNullBindingException(IBinding binding)
public static org.apache.hivemind.ApplicationRuntimeException createNoSuchComponentException(IComponent component, java.lang.String id, org.apache.hivemind.Location location)
public static BindingException createRequiredParameterException(IComponent component, java.lang.String parameterName)
public static org.apache.hivemind.ApplicationRuntimeException createRenderOnlyPropertyException(IComponent component, java.lang.String propertyName)
public static void clearMethodInvocations()
checkMethodInvocation(Object, String, Object)
public static void addMethodInvocation(java.lang.Object methodId)
checkMethodInvocation(Object, String, Object)
public static void checkMethodInvocation(java.lang.Object methodId, java.lang.String methodName, java.lang.Object object)
The caller should invoke clearMethodInvocations()
, then invoke a method on the
object. The super-class implementation should invoke addMethodInvocation(Object)
to
indicate that it was, in fact, invoked. The caller then invokes this method to validate that
the super-class implementation was invoked.
The list of method invocations is stored in a ThreadLocal
variable.
public static void fireObservedChange(IComponent component, java.lang.String propertyName, java.lang.Object newValue)
component
- the component containing the propertypropertyName
- the name of the property which changednewValue
- the new value for the propertypublic static boolean isBlank(java.lang.String input)
HiveMind.isBlank(java.lang.String)
instead.
Note: Yes, you'd think we'd use StringUtils
, but with the change in names and
behavior between releases, it is smarter to just implement our own little method!
public static boolean isNonBlank(java.lang.String input)
HiveMind.isNonBlank(java.lang.String)
instead.