|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.Tapestry
public final class Tapestry
A placeholder for a number of (static) methods that don't belong elsewhere, as well as a global location for static constants.
Field Summary | |
---|---|
static String |
ABSTRACTPAGE_DETACH_METHOD_ID
Method id used to check that IPage.detach() is invoked. |
static String |
ABSTRACTPAGE_VALIDATE_METHOD_ID
Method id used to check that IPage.validate(IRequestCycle) is invoked. |
static String |
ASSET_SERVICE
The name ("asset") of a service used to access internal assets. |
static String |
DIRECT_EVENT_SERVICE
Almost identical to the direct service, except specifically for handling browser level events. |
static String |
DIRECT_SERVICE
The name ("direct") of a service that allows stateless behavior for an DirectLink component. |
static String |
EXTERNAL_SERVICE
The name ("external") of a service that a allows IExternalPage to be selected. |
static String |
HOME_SERVICE
The name ("home") of a service that jumps to the home page. |
static String |
LINK_COMPONENT_ATTRIBUTE_NAME
The name of an IRequestCycle attribute in which the currently
rendering ILinkComponent is stored. |
static String |
MULTIPART_DECODER_EXTENSION_NAME
Name of optional application extension for the multipart decoder used by the application. |
static String |
OGNL_TYPE_CONVERTER
Class name of an TypeConverter implementing class to use as a type converter for
ExpressionBinding . |
static String |
PAGE_SERVICE
The name ("page") of a service that allows a new page to be selected. |
static 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 String |
REQUEST_DECODER_EXTENSION_NAME
Key used to obtain an extension from the application specification. |
static String |
RESET_SERVICE
The name ("reset") of a service used to clear cached template and specification data and remove all pooled pages. |
static String |
RESTART_SERVICE
The name ("restart") of a service that invalidates the session and restarts the application. |
static String |
SIMPLE_PROPERTY_NAME_PATTERN
Regular expression defining a simple property name. |
static String |
TEMPLATE_EXTENSION_PROPERTY
Property name used to get the extension used for templates. |
static String |
VERSION
The version of the framework; this is updated for major releases. |
Method Summary | |
---|---|
static void |
addMethodInvocation(Object methodId)
Adds a method invocation to the list of invocations. |
static void |
checkMethodInvocation(Object methodId,
String methodName,
Object object)
Checks to see if a particular method has been invoked. |
static void |
clearMethodInvocations()
Clears the list of method invocations. |
static void |
close(InputStream stream)
Closes the stream (if not null), ignoring any IOException thrown. |
static Map |
convertArrayToMap(Object[] array)
Converts an even-sized array of objects back into a Map . |
static Object[] |
convertMapToArray(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,
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,
String propertyName)
|
static BindingException |
createRequiredParameterException(IComponent component,
String parameterName)
|
static void |
fireObservedChange(IComponent component,
String propertyName,
Object newValue)
Method used by pages and components to send notifications about property changes. |
static String |
format(String key,
Object arg)
Convienience method for invoking format(String, Object[]) . |
static String |
format(String key,
Object[] args)
Gets a string from the TapestryStrings resource bundle. |
static String |
format(String key,
Object arg1,
Object arg2)
Convienience method for invoking format(String, Object[]) . |
static String |
format(String key,
Object arg1,
Object arg2,
Object arg3)
Convienience method for invoking format(String, Object[]) . |
static Locale |
getLocale(String s)
Gets the Locale for the given string, which is the result of
Locale.toString() . |
static String |
getMessage(String key)
Convienience method for invoking format(String, Object[]) . |
static boolean |
isEmpty(Collection c)
Returns true if the Collection is null or empty. |
static boolean |
isEmpty(Map map)
Returns true if the Map is null or empty. |
static int |
size(Collection c)
Returns the size of a collection, or zero if the collection is null. |
static int |
size(Object[] array)
Returns the length of the array, or 0 if the array is null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final 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 String DIRECT_EVENT_SERVICE
public static final 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 String PAGE_SERVICE
PageLink
component.
The service requires a single parameter: the name of the target page.
public static final String HOME_SERVICE
public static final String RESTART_SERVICE
public static final String ASSET_SERVICE
public static final 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 String TEMPLATE_EXTENSION_PROPERTY
public static final String LINK_COMPONENT_ATTRIBUTE_NAME
IRequestCycle
attribute in which the currently
rendering ILinkComponent
is stored. Link components do
not nest.
public static final String PARAMETER_PROPERTY_NAME_SUFFIX
public static final String REQUEST_DECODER_EXTENSION_NAME
IRequestDecoder
.
public static final String MULTIPART_DECODER_EXTENSION_NAME
IMultipartDecoder
(and is
generally a configured instance of
IMultipartDecoder
).
public static final String ABSTRACTPAGE_VALIDATE_METHOD_ID
IPage.validate(IRequestCycle)
is invoked.
checkMethodInvocation(Object, String, Object)
,
Constant Field Valuespublic static final String ABSTRACTPAGE_DETACH_METHOD_ID
IPage.detach()
is invoked.
checkMethodInvocation(Object, String, Object)
,
Constant Field Valuespublic static final String SIMPLE_PROPERTY_NAME_PATTERN
public static final String OGNL_TYPE_CONVERTER
TypeConverter
implementing class to use as a type converter for
ExpressionBinding
.
public static final String VERSION
Method Detail |
---|
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 Locale getLocale(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(InputStream stream)
IOException
thrown.
public static String format(String key, Object[] args)
MessageFormat.format(java.lang.String, java.lang.Object[])
.
public static String getMessage(String key)
format(String, Object[])
.
public static String format(String key, Object arg)
format(String, Object[])
.
public static String format(String key, Object arg1, Object arg2)
format(String, Object[])
.
public static String format(String key, Object arg1, Object arg2, Object arg3)
format(String, Object[])
.
public static int size(Collection c)
public static int size(Object[] array)
public static boolean isEmpty(Map map)
public static boolean isEmpty(Collection c)
public static Object[] convertMapToArray(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 Map convertArrayToMap(Object[] array)
Map
.
convertMapToArray(Map)
public static BindingException createNullBindingException(IBinding binding)
public static org.apache.hivemind.ApplicationRuntimeException createNoSuchComponentException(IComponent component, String id, org.apache.hivemind.Location location)
public static BindingException createRequiredParameterException(IComponent component, String parameterName)
public static org.apache.hivemind.ApplicationRuntimeException createRenderOnlyPropertyException(IComponent component, String propertyName)
public static void clearMethodInvocations()
checkMethodInvocation(Object, String, Object)
public static void addMethodInvocation(Object methodId)
checkMethodInvocation(Object, String, Object)
public static void checkMethodInvocation(Object methodId, String methodName, 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, String propertyName, Object newValue)
component
- the component containing the propertypropertyName
- the name of the property which changednewValue
- the new value for the property
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |