You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2006/03/11 21:55:35 UTC
svn commit: r385164 [11/32] - in /jakarta/tapestry/trunk: ./ .settings/
annotations/src/java/org/apache/tapestry/annotations/
annotations/src/test/org/apache/tapestry/annotations/ config/
contrib/src/documentation/content/xdocs/tapestry-contrib/Compone...
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ApplicationServlet.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ApplicationServlet.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ApplicationServlet.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/ApplicationServlet.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -40,12 +40,11 @@
import org.apache.tapestry.util.exception.ExceptionAnalyzer;
/**
- * Links a servlet container with a Tapestry application. The servlet init
- * parameter <code>org.apache.tapestry.application-specification</code> should
- * be set to the complete resource path (within the classpath) to the
- * application specification, i.e., <code>/com/foo/bar/MyApp.application</code>.
- * As of release 4.0, this servlet will also create a HiveMind Registry and
- * manage it.
+ * Links a servlet container with a Tapestry application. The servlet init parameter
+ * <code>org.apache.tapestry.application-specification</code> should be set to the complete
+ * resource path (within the classpath) to the application specification, i.e.,
+ * <code>/com/foo/bar/MyApp.application</code>. As of release 4.0, this servlet will also create
+ * a HiveMind Registry and manage it.
*
* @author Howard Lewis Ship
* @see org.apache.tapestry.services.ApplicationInitializer
@@ -54,39 +53,31 @@
public class ApplicationServlet extends HttpServlet
{
-
- private static final Log LOG = LogFactory.getLog(ApplicationServlet.class);
+ private static final long serialVersionUID = -8046042689991538059L;
/**
- * Prefix used to store the HiveMind Registry into the ServletContext. This
- * string is suffixed with the servlet name (in case multiple Tapestry
- * applications are executing within a single web application).
+ * Prefix used to store the HiveMind Registry into the ServletContext. This string is suffixed
+ * with the servlet name (in case multiple Tapestry applications are executing within a single
+ * web application).
*
* @since 4.0
*/
private static final String REGISTRY_KEY_PREFIX = "org.apache.tapestry.Registry:";
- private static final long serialVersionUID = -8046042689991538059L;
-
- /**
- * @since 4.0
- */
-
- private Registry _registry;
+ private static final Log LOG = LogFactory.getLog(ApplicationServlet.class);
/**
- * The key used to store the registry into the ServletContext.
+ * Invokes {@link #doService(HttpServletRequest, HttpServletResponse)}.
*
- * @since 4.0
+ * @since 1.0.6
*/
- private String _registryKey;
-
- /**
- * @since 4.0
- */
- private ServletRequestServicer _requestServicer;
+ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,
+ ServletException
+ {
+ doService(request, response);
+ }
/**
* @since 2.3
@@ -95,128 +86,35 @@
private ClassResolver _resolver;
/**
- * Looks for a file in the servlet context; if it exists, it is expected to
- * be a HiveMind module descriptor, and is added to the builder.
+ * The key used to store the registry into the ServletContext.
*
* @since 4.0
*/
- protected void addModuleIfExists(RegistryBuilder builder, ServletContext context, String path)
- {
- Resource r = new ContextResource(context, path);
-
- if (r.getResourceURL() == null) return;
-
- builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver, r));
- }
-
- /**
- * Invoked by {@link #constructRegistry(ServletConfig)} to create and return
- * an {@link ErrorHandler} instance to be used when constructing the
- * Registry (and then to handle any runtime exceptions). This implementation
- * returns a new instance of
- * {@link org.apache.hivemind.impl.StrictErrorHandler}.
- *
- * @since 4.0
- */
- protected ErrorHandler constructErrorHandler(ServletConfig config)
- {
- return new StrictErrorHandler();
- }
+ private String _registryKey;
/**
- * Invoked from {@link #init(ServletConfig)}to construct the Registry to be
- * used by the application.
- * <p>
- * This looks in the standard places (on the classpath), but also in the
- * WEB-INF/name and WEB-INF folders (where name is the name of the servlet).
- *
* @since 4.0
*/
- protected Registry constructRegistry(ServletConfig config)
- {
- ErrorHandler errorHandler = constructErrorHandler(config);
-
- RegistryBuilder builder = new RegistryBuilder(errorHandler);
-
- builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver));
-
- String name = config.getServletName();
- ServletContext context = config.getServletContext();
-
- addModuleIfExists(builder, context, "/WEB-INF/" + name + "/hivemodule.xml");
- addModuleIfExists(builder, context, "/WEB-INF/hivemodule.xml");
-
- return builder.constructRegistry(Locale.getDefault());
- }
-
- /**
- * Invoked from {@link #init(ServletConfig)}to create a resource resolver
- * for the servlet (which will utlimately be shared and used through the
- * application).
- * <p>
- * This implementation constructs a {@link DefaultResourceResolver},
- * subclasses may provide a different implementation.
- *
- * @see #getResourceResolver()
- * @since 2.3
- */
- protected ClassResolver createClassResolver()
- {
- return new DefaultClassResolver();
- }
+ private Registry _registry;
/**
- * Shuts down the registry (if it exists).
- *
* @since 4.0
*/
- public void destroy()
- {
- getServletContext().removeAttribute(_registryKey);
-
- if (_registry != null)
- {
- _registry.shutdown();
- _registry = null;
- }
- }
-
- /**
- * Invokes {@link #doService(HttpServletRequest, HttpServletResponse)}.
- *
- * @since 1.0.6
- */
-
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
- {
- doService(request, response);
- }
-
- /**
- * Invokes {@link #doService(HttpServletRequest, HttpServletResponse)}.
- */
-
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
- {
- doService(request, response);
- }
+ private ServletRequestServicer _requestServicer;
/**
* Handles the GET and POST requests. Performs the following:
* <ul>
* <li>Construct a {@link RequestContext}
- * <li>Invoke {@link #getEngine(RequestContext)}to get or create the
- * {@link IEngine}
+ * <li>Invoke {@link #getEngine(RequestContext)}to get or create the {@link IEngine}
* <li>Invoke {@link IEngine#service(RequestContext)}on the application
* </ul>
*/
protected void doService(HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
+ throws IOException, ServletException
{
try
{
@@ -250,17 +148,35 @@
}
}
+ protected void show(Exception ex)
+ {
+ System.err.println("\n\n**********************************************************\n\n");
+
+ new ExceptionAnalyzer().reportException(ex, System.err);
+
+ System.err.println("\n**********************************************************\n");
+
+ }
+
+ /**
+ * Invokes {@link #doService(HttpServletRequest, HttpServletResponse)}.
+ */
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ doService(request, response);
+ }
+
/**
- * Reads the application specification when the servlet is first
- * initialized. All {@link IEngine engine instances}will have access to the
- * specification via the servlet.
+ * Reads the application specification when the servlet is first initialized. All
+ * {@link IEngine engine instances}will have access to the specification via the servlet.
*
* @see #constructApplicationSpecification()
* @see #createResourceResolver()
*/
- public void init(ServletConfig config)
- throws ServletException
+ public void init(ServletConfig config) throws ServletException
{
String name = config.getServletName();
@@ -296,32 +212,112 @@
}
/**
- * Invoked from {@link #init(ServletConfig)}, after the registry has been
- * constructed, to bootstrap the application via the
- * <code>tapestry.MasterApplicationInitializer</code> service.
+ * Invoked from {@link #init(ServletConfig)}to create a resource resolver for the servlet
+ * (which will utlimately be shared and used through the application).
+ * <p>
+ * This implementation constructs a {@link DefaultResourceResolver}, subclasses may provide a
+ * different implementation.
+ *
+ * @see #getResourceResolver()
+ * @since 2.3
+ */
+
+ protected ClassResolver createClassResolver()
+ {
+ return new DefaultClassResolver();
+ }
+
+ /**
+ * Invoked from {@link #init(ServletConfig)}to construct the Registry to be used by the
+ * application.
+ * <p>
+ * This looks in the standard places (on the classpath), but also in the WEB-INF/name and
+ * WEB-INF folders (where name is the name of the servlet).
+ *
+ * @since 4.0
+ */
+ protected Registry constructRegistry(ServletConfig config)
+ {
+ ErrorHandler errorHandler = constructErrorHandler(config);
+
+ RegistryBuilder builder = new RegistryBuilder(errorHandler);
+
+ builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver));
+
+ String name = config.getServletName();
+ ServletContext context = config.getServletContext();
+
+ addModuleIfExists(builder, context, "/WEB-INF/" + name + "/hivemodule.xml");
+ addModuleIfExists(builder, context, "/WEB-INF/hivemodule.xml");
+
+ return builder.constructRegistry(Locale.getDefault());
+ }
+
+ /**
+ * Invoked by {@link #constructRegistry(ServletConfig)} to create and return an
+ * {@link ErrorHandler} instance to be used when constructing the Registry (and then to handle
+ * any runtime exceptions). This implementation returns a new instance of
+ * {@link org.apache.hivemind.impl.StrictErrorHandler}.
+ *
+ * @since 4.0
+ */
+ protected ErrorHandler constructErrorHandler(ServletConfig config)
+ {
+ return new StrictErrorHandler();
+ }
+
+ /**
+ * Looks for a file in the servlet context; if it exists, it is expected to be a HiveMind module
+ * descriptor, and is added to the builder.
+ *
+ * @since 4.0
+ */
+
+ protected void addModuleIfExists(RegistryBuilder builder, ServletContext context, String path)
+ {
+ Resource r = new ContextResource(context, path);
+
+ if (r.getResourceURL() == null)
+ return;
+
+ builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver, r));
+ }
+
+ /**
+ * Invoked from {@link #init(ServletConfig)}, after the registry has been constructed, to
+ * bootstrap the application via the <code>tapestry.MasterApplicationInitializer</code>
+ * service.
*
* @since 4.0
*/
protected void initializeApplication()
{
- ApplicationInitializer ai = (ApplicationInitializer)_registry.getService("tapestry.init.MasterInitializer",
+ ApplicationInitializer ai = (ApplicationInitializer) _registry.getService(
+ "tapestry.init.MasterInitializer",
ApplicationInitializer.class);
ai.initialize(this);
_registry.cleanupThread();
- _requestServicer = (ServletRequestServicer)_registry.getService("tapestry.request.ServletRequestServicer",
+ _requestServicer = (ServletRequestServicer) _registry.getService(
+ "tapestry.request.ServletRequestServicer",
ServletRequestServicer.class);
}
- protected void show(Exception ex)
+ /**
+ * Shuts down the registry (if it exists).
+ *
+ * @since 4.0
+ */
+ public void destroy()
{
- System.err.println("\n\n**********************************************************\n\n");
-
- new ExceptionAnalyzer().reportException(ex, System.err);
-
- System.err.println("\n**********************************************************\n");
+ getServletContext().removeAttribute(_registryKey);
+ if (_registry != null)
+ {
+ _registry.shutdown();
+ _registry = null;
+ }
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/BindingException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/BindingException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/BindingException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/BindingException.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,17 +19,18 @@
import org.apache.hivemind.Location;
/**
- * A general exception describing an {@link IBinding} and an {@link IComponent}.
- *
- * @author Howard Lewis Ship
- */
+ * A general exception describing an {@link IBinding}
+ * and an {@link IComponent}.
+ *
+ * @author Howard Lewis Ship
+ *
+ **/
public class BindingException extends ApplicationRuntimeException
{
-
private static final long serialVersionUID = 1336659143140967861L;
-
- private transient IBinding _binding;
+
+ private transient IBinding _binding;
public BindingException(String message, IBinding binding)
{
@@ -41,9 +42,19 @@
this(message, null, null, binding, rootCause);
}
- public BindingException(String message, Object component, Location location, IBinding binding, Throwable rootCause)
+
+ public BindingException(
+ String message,
+ Object component,
+ Location location,
+ IBinding binding,
+ Throwable rootCause)
{
- super(message, component, HiveMind.findLocation(new Object[] { location, binding, component }), rootCause);
+ super(
+ message,
+ component,
+ HiveMind.findLocation(new Object[] { location, binding, component }),
+ rootCause);
_binding = binding;
}
@@ -52,4 +63,4 @@
{
return _binding;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Constants.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Constants.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Constants.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Constants.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,18 +15,16 @@
package org.apache.tapestry;
/**
- * Constant values used inside Tapestry.
- *
+ * Constant values used inside Tapestry.
+ *
* @author Howard Lewis Ship
* @since 4.0
*/
public final class Constants
{
-
- /**
- * Key used to store and locate an
- * {@link org.apache.tapestry.services.Infrastructure} service instance as a
- * request attribute.
- */
- public static final String INFRASTRUCTURE_KEY = "org.apache.tapestry.Infrastructure";
+ /**
+ * Key used to store and locate an {@link org.apache.tapestry.services.Infrastructure}
+ * service instance as a request attribute.
+ */
+ public static final String INFRASTRUCTURE_KEY = "org.apache.tapestry.Infrastructure";
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/FormBehavior.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/FormBehavior.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/FormBehavior.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/FormBehavior.java Sat Mar 11 12:54:27 2006
@@ -34,7 +34,7 @@
* @deprecated Wiring of form event handlers is now managed on the client side. This method may
* be removed in a future release of Tapestry.
*/
- void addEventHandler(FormEventType type, String functionName);
+ public void addEventHandler(FormEventType type, String functionName);
/**
* Adds a hidden field value to be stored in the form. This ensures that all of the <input
@@ -45,7 +45,7 @@
* the order they are received.
*/
- void addHiddenValue(String name, String value);
+ public void addHiddenValue(String name, String value);
/**
* Adds a hidden field value to be stored in the form. This ensures that all of the <input
@@ -58,7 +58,7 @@
* @since 3.0
*/
- void addHiddenValue(String name, String id, String value);
+ public void addHiddenValue(String name, String id, String value);
/**
* Constructs a unique identifier (within the Form). The identifier consists of the component's
@@ -71,7 +71,7 @@
* is different, and should be unique within the rendered page.
*/
- String getElementId(IFormComponent component);
+ public String getElementId(IFormComponent component);
/**
* Constructs a unique identifier from the base id. If possible, the id is used as-is.
@@ -89,14 +89,14 @@
* time it was submitted.
*/
- String getElementId(IFormComponent component, String baseId);
+ public String getElementId(IFormComponent component, String baseId);
/**
* Returns true if the form is rewinding (meaning, the form was the subject of the request
* cycle).
*/
- boolean isRewinding();
+ public boolean isRewinding();
/**
* May be invoked by a component to force the encoding type of the form to a particular value.
@@ -107,7 +107,7 @@
* type
*/
- void setEncodingType(String encodingType);
+ public void setEncodingType(String encodingType);
/**
* Pre-renders the specified field, buffering the result for later use by
@@ -124,7 +124,7 @@
* @param location
* an optional location (of the FieldLabel component) used when reporting errors.
*/
- void prerenderField(IMarkupWriter writer, IComponent field, Location location);
+ public void prerenderField(IMarkupWriter writer, IComponent field, Location location);
/**
* Invoked by a form control component (a field) that may have been pre-rendered. If the field
@@ -134,7 +134,7 @@
* @return true if the field was pre-rendered and should do nothing during its render phase,
* false if the field should continue as normal.
*/
- boolean wasPrerendered(IMarkupWriter writer, IComponent field);
+ public boolean wasPrerendered(IMarkupWriter writer, IComponent field);
/**
* Adds a deferred runnable, an object to be executed either before the </form> tag is
@@ -145,7 +145,7 @@
* the object to execute (which may not be null)
*/
- void addDeferredRunnable(Runnable runnable);
+ public void addDeferredRunnable(Runnable runnable);
/**
* Registers a field for automatic focus. The goal is for the first field that is in error to
@@ -159,6 +159,6 @@
* @since 4.0
*/
- void registerForFocus(IFormComponent field, int priority);
+ public void registerForFocus(IFormComponent field, int priority);
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IBeanProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IBeanProvider.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IBeanProvider.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IBeanProvider.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,60 +19,65 @@
import org.apache.hivemind.ClassResolver;
/**
- * An object that provides a component with access to helper beans. Helper beans
- * are JavaBeans associated with a page or component that are used to extend the
- * functionality of the component via aggregation.
- *
- * @author Howard Lewis Ship
- * @since 1.0.4
- */
+ * An object that provides a component with access to helper beans.
+ * Helper beans are JavaBeans associated with a page or component
+ * that are used to extend the functionality of the component via
+ * aggregation.
+ *
+ * @author Howard Lewis Ship
+ * @since 1.0.4
+ **/
+
public interface IBeanProvider
{
-
- /**
- * Returns the JavaBean with the specified name. The bean is created as
- * needed.
- *
- * @throws ApplicationRuntimeException
- * if no such bean is available.
- */
-
- public Object getBean(String name);
-
- /**
- * Returns the {@link IComponent} (which may be a
- * {@link org.apache.tapestry.IPage}) for which this bean provider is
- * providing beans.
- *
- * @since 1.0.5
- */
-
- public IComponent getComponent();
-
+ /**
+ * Returns the JavaBean with the specified name. The bean is created as needed.
+ *
+ * @throws ApplicationRuntimeException if no such bean is available.
+ *
+ **/
+
+ public Object getBean(String name);
+
+ /**
+ * Returns the {@link IComponent} (which may be a
+ * {@link org.apache.tapestry.IPage}) for which
+ * this bean provider is providing beans.
+ *
+ * @since 1.0.5
+ **/
+
+ public IComponent getComponent();
+
+ /**
+ * Returns a collection of the names of any beans which may
+ * be provided.
+ *
+ * @since 1.0.6
+ * @see org.apache.tapestry.spec.IComponentSpecification#getBeanNames()
+ *
+ **/
+
+ public Collection getBeanNames();
+
/**
- * Returns a collection of the names of any beans which may be provided.
+ * Returns true if the provider can provide the named bean.
*
- * @since 1.0.6
- * @see org.apache.tapestry.spec.IComponentSpecification#getBeanNames()
- */
-
- public Collection getBeanNames();
-
- /**
- * Returns true if the provider can provide the named bean.
+ * @since 2.2
*
- * @since 2.2
- */
-
+ **/
+
public boolean canProvideBean(String name);
-
- /**
- * Returns a resource resolver.
- *
- * @since 1.0.8
- */
-
- public ClassResolver getClassResolver();
-
+
+ /**
+ * Returns a resource resolver.
+ *
+ * @since 1.0.8
+ *
+ **/
+
+ public ClassResolver getClassResolver();
+
}
+
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IComponent.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IComponent.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IComponent.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IComponent.java Sat Mar 11 12:54:27 2006
@@ -40,7 +40,7 @@
* Adds an asset to the component. This is invoked from the page loader.
*/
- void addAsset(String name, IAsset asset);
+ public void addAsset(String name, IAsset asset);
/**
* Adds a component to a container. Should only be called during the page loading process, which
@@ -49,7 +49,7 @@
* @see IPageLoader
*/
- void addComponent(IComponent component);
+ public void addComponent(IComponent component);
/**
* Adds a new renderable element to the receiver's body. The element may be either another
@@ -62,7 +62,7 @@
* @since 2.2
*/
- void addBody(IRender element);
+ public void addBody(IRender element);
/**
* Returns the asset map for the component, which may be empty but will not be null.
@@ -70,13 +70,13 @@
* The return value is unmodifiable.
*/
- Map getAssets();
+ public Map getAssets();
/**
* Returns the named asset, or null if not found.
*/
- IAsset getAsset(String name);
+ public IAsset getAsset(String name);
/**
* Returns the binding with the given name or null if not found.
@@ -84,7 +84,7 @@
* Bindings are added to a component using {@link #setBinding(String,IBinding)}.
*/
- IBinding getBinding(String name);
+ public IBinding getBinding(String name);
/**
* Returns a {@link Collection}of the names of all bindings (which includes bindings for both
@@ -94,7 +94,7 @@
* empty for a component with no bindings.
*/
- Collection getBindingNames();
+ public Collection getBindingNames();
/**
* Returns a {@link Map}of the {@link IBinding bindings}for this component; this includes
@@ -103,7 +103,7 @@
* @since 1.0.5
*/
- Map getBindings();
+ public Map getBindings();
/**
* Retrieves an contained component by its id. Contained components have unique ids within their
@@ -113,7 +113,7 @@
* runtime exception thrown if the named component does not exist.
*/
- IComponent getComponent(String id);
+ public IComponent getComponent(String id);
/**
* Returns the component which embeds the receiver. All components are contained within other
@@ -122,14 +122,14 @@
* A page returns null.
*/
- IComponent getContainer();
+ public IComponent getContainer();
/**
* Sets the container of the component. This is write-once, an attempt to change it later will
* throw an {@link ApplicationRuntimeException}.
*/
- void setContainer(IComponent value);
+ public void setContainer(IComponent value);
/**
* Returns a string identifying the name of the page and the id path of the reciever within the
@@ -140,7 +140,7 @@
* @see #getIdPath()
*/
- String getExtendedId();
+ public String getExtendedId();
/**
* Returns the simple id of the component, as defined in its specification.
@@ -150,14 +150,14 @@
* A {@link IPage page}will always return null.
*/
- String getId();
+ public String getId();
/**
* Sets the id of the component. This is write-once, an attempt to change it later will throw an
* {@link ApplicationRuntimeException}.
*/
- void setId(String value);
+ public void setId(String value);
/**
* Returns the qualified id of the component. This represents a path from the {@link IPage page}
@@ -170,26 +170,26 @@
* @see #getId()
*/
- String getIdPath();
+ public String getIdPath();
/**
* Returns the page which ultimately contains the receiver. A page will return itself.
*/
- IPage getPage();
+ public IPage getPage();
/**
* Sets the page which ultimiately contains the component. This is write-once, an attempt to
* change it later will throw an {@link ApplicationRuntimeException}.
*/
- void setPage(IPage value);
+ public void setPage(IPage value);
/**
* Returns the specification which defines the component.
*/
- IComponentSpecification getSpecification();
+ public IComponentSpecification getSpecification();
/**
* Invoked to make the receiver render its body (the elements and components its tag wraps
@@ -199,7 +199,7 @@
* @since 2.2
*/
- void renderBody(IMarkupWriter writer, IRequestCycle cycle);
+ public void renderBody(IMarkupWriter writer, IRequestCycle cycle);
/**
* Adds a binding to a container. Should only be called during the page loading process (which
@@ -208,7 +208,7 @@
* @see IPageLoader
*/
- void setBinding(String name, IBinding binding);
+ public void setBinding(String name, IBinding binding);
/**
* Returns the contained components as an unmodifiable {@link Map}. This allows peer components
@@ -225,7 +225,7 @@
* null.
*/
- Map getComponents();
+ public Map getComponents();
/**
* Allows a component to finish any setup after it has been constructed.
@@ -241,7 +241,7 @@
* @since 0.2.12
*/
- void finishLoad(IRequestCycle cycle, IPageLoader loader,
+ public void finishLoad(IRequestCycle cycle, IPageLoader loader,
IComponentSpecification specification);
/**
@@ -251,7 +251,7 @@
* @since 3.0
*/
- Messages getMessages();
+ public Messages getMessages();
/**
* Returns the {@link INamespace}in which the component was defined (as an alias).
@@ -259,7 +259,7 @@
* @since 2.2
*/
- INamespace getNamespace();
+ public INamespace getNamespace();
/**
* Sets the {@link INamespace}for the component. The namespace should only be set once.
@@ -267,7 +267,7 @@
* @since 2.2
*/
- void setNamespace(INamespace namespace);
+ public void setNamespace(INamespace namespace);
/**
* Sets a property of a component.
@@ -279,7 +279,7 @@
* @deprecated To be removed in 4.1. Use
* {@link org.apache.hivemind.util.PropertyUtils#read(java.lang.Object, java.lang.String) instead.
*/
- void setProperty(String propertyName, Object value);
+ public void setProperty(String propertyName, Object value);
/**
* Gets a property of a component.
@@ -291,7 +291,7 @@
* {@link org.apache.hivemind.util.PropertyUtils#read(java.lang.Object, java.lang.String)}
* instead
*/
- Object getProperty(String propertyName);
+ public Object getProperty(String propertyName);
/**
* Returns true if the component is currently rendering.
@@ -299,7 +299,7 @@
* @since 4.0
*/
- boolean isRendering();
+ public boolean isRendering();
/**
* Invoked after {@link #finishLoad(IRequestCycle, IPageLoader, IComponentSpecification)}to
@@ -310,7 +310,7 @@
* @since 4.0
*/
- void enterActiveState();
+ public void enterActiveState();
/**
* Returns a {@link IBeanProvider} from which managed beans can be obtained.
@@ -318,7 +318,7 @@
* @since 4.0
*/
- IBeanProvider getBeans();
+ public IBeanProvider getBeans();
/**
* Returns a {@link ListenerMap} for the component. The map contains a number of synthetic
@@ -328,7 +328,7 @@
* @since 4.0
*/
- ListenerMap getListeners();
+ public ListenerMap getListeners();
/**
* Returns a localized string message. Each component has an optional set of localized message
@@ -342,7 +342,7 @@
* @deprecated To be removed in release 4.1. Use {@link #getMessages()} instead.
*/
- String getMessage(String key);
+ public String getMessage(String key);
/**
* Returns the {@link org.apache.tapestry.spec.IContainedComponent}. This will be null for
@@ -354,7 +354,7 @@
* @since 4.0
*/
- IContainedComponent getContainedComponent();
+ public IContainedComponent getContainedComponent();
/**
* Sets the {@link #getContainedComponent()} property; this may only be done once.
@@ -363,5 +363,5 @@
* may not be null
* @since 4.0
*/
- void setContainedComponent(IContainedComponent containedComponent);
-}
+ public void setContainedComponent(IContainedComponent containedComponent);
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IMarkupWriter.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IMarkupWriter.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IMarkupWriter.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IMarkupWriter.java Sat Mar 11 12:54:27 2006
@@ -32,7 +32,7 @@
* if there is no open tag.
*/
- void attribute(String name, int value);
+ public void attribute(String name, int value);
/**
* Writes a boolean attribute into the currently open tag.
@@ -42,7 +42,7 @@
* @since 3.0
*/
- void attribute(String name, boolean value);
+ public void attribute(String name, boolean value);
/**
* Writes an attribute into the most recently opened tag. This must be called after
@@ -54,7 +54,7 @@
* if there is no open tag.
*/
- void attribute(String name, String value);
+ public void attribute(String name, String value);
/**
* Similar to {@link #attribute(String, String)}but no escaping of invalid elements is done for
@@ -65,27 +65,27 @@
* @since 3.0
*/
- void attributeRaw(String name, String value);
+ public void attributeRaw(String name, String value);
/**
* Closes any existing tag then starts a new element. The new element is pushed onto the active
* element stack.
*/
- void begin(String name);
+ public void begin(String name);
/**
* Starts an element that will not later be matched with an <code>end()</code> call. This is
* useful for elements that do not need closing tags.
*/
- void beginEmpty(String name);
+ public void beginEmpty(String name);
/**
* Invokes checkError() on the <code>PrintWriter</code> used to format output.
*/
- boolean checkError();
+ public boolean checkError();
/**
* Closes this <code>IMarkupWriter</code>. Close tags are written for any active elements.
@@ -93,7 +93,7 @@
* commit its buffer to its containing writer.
*/
- void close();
+ public void close();
/**
* Closes the most recently opened element by writing the '>' that ends it. Once this is
@@ -101,7 +101,7 @@
* with {@link #begin(String)}or or {@link #beginEmpty(String)}.
*/
- void closeTag();
+ public void closeTag();
/**
* Writes an XML/HTML comment. Any open tag is first closed. The method takes care of providing
@@ -112,28 +112,28 @@
* (much like {@link #printRaw(String)}.
*/
- void comment(String value);
+ public void comment(String value);
/**
* Ends the element most recently started by {@link#begin(String)}. The name of the tag is
* popped off of the active element stack and used to form an HTML close tag.
*/
- void end();
+ public void end();
/**
* Ends the most recently started element with the given name. This will also end any other
* intermediate elements. This is very useful for easily ending a table or even an entire page.
*/
- void end(String name);
+ public void end(String name);
/**
* Forwards <code>flush()</code> to this <code>IMarkupWriter</code>'s
* <code>PrintWriter</code>.
*/
- void flush();
+ public void flush();
/**
* Returns a nested writer, one that accumulates its changes in a buffer. When the nested writer
@@ -141,14 +141,14 @@
* using {@link #printRaw(String)}.
*/
- NestedMarkupWriter getNestedWriter();
+ public NestedMarkupWriter getNestedWriter();
/**
* Version of {@link #print(char[], int, int, boolean)} that assumes filter is
* <em>enabled</em>.
*/
- void print(char[] data, int offset, int length);
+ public void print(char[] data, int offset, int length);
/**
* The primary <code>print()</code> method, used by most other methods.
@@ -171,7 +171,7 @@
* @since 4.0
*/
- void print(char[] data, int offset, int length, boolean raw);
+ public void print(char[] data, int offset, int length, boolean raw);
/**
* Prints a single character, or its equivalent entity.
@@ -179,7 +179,7 @@
* Closes any open tag.
*/
- void print(char value);
+ public void print(char value);
/**
* Prints an integer.
@@ -187,44 +187,44 @@
* Closes any open tag.
*/
- void print(int value);
+ public void print(int value);
/**
* As with {@link #print(char[], int, int, boolean)}, but the data to print is defined by the
* String. Assumes filtering is <em>enabled</em>.
*/
- void print(String value);
+ public void print(String value);
/**
* As with {@link #print(char[], int, int, boolean)}, but the data to print is defined by the
* String.
*/
- void print(String value, boolean raw);
+ public void print(String value, boolean raw);
/**
* Closes the open tag (if any), then prints a line seperator to the output stream.
*/
- void println();
+ public void println();
/**
* Version of {@link #print(char[], int, int, boolean)}that assumes filter is <em>enabled</em>.
*/
- void printRaw(char[] buffer, int offset, int length);
+ public void printRaw(char[] buffer, int offset, int length);
/**
* As with {@link #print(char[], int, int, boolean)}, but the data to print is defined by the
* String. Assumes filtering is <em>disabled</em>.
*/
- void printRaw(String value);
+ public void printRaw(String value);
/**
* Returns the type of content generated by this response writer, as a MIME type.
*/
- String getContentType();
-}
+ public String getContentType();
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IPage.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IPage.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IPage.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/IPage.java Sat Mar 11 12:54:27 2006
@@ -16,6 +16,7 @@
import java.util.Locale;
+import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.tapestry.event.ChangeObserver;
import org.apache.tapestry.event.PageAttachListener;
import org.apache.tapestry.event.PageBeginRenderListener;
@@ -117,6 +118,18 @@
*/
public void attach(IEngine engine, IRequestCycle cycle);
+
+ /**
+ * Used to explicitly fire {@link PageAttachListener}s for this page. This is used when a page
+ * is first loaded; The page loader attaches the newly created page <em>instance</em> before
+ * the rest of the page and components is loaded. In order to have meaningful event
+ * notifications when a page is first loaded (rather than pulled from the pool), it is necessary
+ * to fire page attach listeners at the end of the load.
+ *
+ * @since 4.0
+ */
+
+ public void firePageAttached();
/**
* Invoked to render the entire page. This should only be invoked by
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageNotFoundException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageNotFoundException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageNotFoundException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageNotFoundException.java Sat Mar 11 12:54:27 2006
@@ -17,19 +17,18 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * Subclass of {@link org.apache.hivemind.ApplicationRuntimeException} thrown
- * when a requested page does not exist.
+ * Subclass of {@link org.apache.hivemind.ApplicationRuntimeException} thrown when a requested
+ * page does not exist.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PageNotFoundException extends ApplicationRuntimeException
{
-
private static final long serialVersionUID = -4776430599632429708L;
- public PageNotFoundException(String message)
+ public PageNotFoundException(String message)
{
super(message);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageRedirectException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageRedirectException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageRedirectException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/PageRedirectException.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,20 +17,18 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * Exception thrown by a {@link IComponent component} or
- * {@link org.apache.tapestry.engine.IEngineService} that wishes to force the
- * application to a particular page. This is often used to protect a sensitive
- * page until the user is authenticated.
- *
- * @author Howard Lewis Ship
- */
+ * Exception thrown by a {@link IComponent component} or {@link org.apache.tapestry.engine.IEngineService}
+ * that wishes to force the application to a particular page. This is often used
+ * to protect a sensitive page until the user is authenticated.
+ *
+ * @author Howard Lewis Ship
+ **/
public class PageRedirectException extends ApplicationRuntimeException
{
-
private static final long serialVersionUID = -7693744317997065965L;
-
- private final String _targetPageName;
+
+ private String _targetPageName;
public PageRedirectException(String targetPageName)
{
@@ -42,7 +40,11 @@
this(page.getPageName());
}
- public PageRedirectException(String message, Object component, Throwable rootCause, String targetPageName)
+ public PageRedirectException(
+ String message,
+ Object component,
+ Throwable rootCause,
+ String targetPageName)
{
super(message, component, null, rootCause);
@@ -53,4 +55,4 @@
{
return _targetPageName;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectException.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,45 +17,46 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * Exception thrown to force a redirection to an arbitrary location. This is
- * used when, after processing a request (such as a form submission or a link
- * being clicked), it is desirable to go to some arbitrary new location.
- *
- * @author Howard Lewis Ship
- * @since 1.0.6
- */
+ * Exception thrown to force a redirection to an arbitrary location.
+ * This is used when, after processing a request (such as a form
+ * submission or a link being clicked), it is desirable to go
+ * to some arbitrary new location.
+ *
+ * @author Howard Lewis Ship
+ * @since 1.0.6
+ *
+ **/
public class RedirectException extends ApplicationRuntimeException
{
-
- private static final long serialVersionUID = -9215837473156146010L;
-
- private String _redirectLocation;
-
- public RedirectException(String redirectLocation)
- {
- this(null, redirectLocation);
- }
-
- /**
- * @param message
- * A message describing why the redirection is taking place.
- * @param redirectLocation
- * The location to redirect to, may be a relative path (relative
- * to the {@link javax.servlet.ServletContext}).
- * @see javax.servlet.http.HttpServletResponse#sendRedirect(String)
- * @see javax.servlet.http.HttpServletResponse#encodeRedirectURL(String)
- */
-
- public RedirectException(String message, String redirectLocation)
- {
- super(message);
-
- _redirectLocation = redirectLocation;
- }
-
- public String getRedirectLocation()
- {
- return _redirectLocation;
- }
-}
+ private static final long serialVersionUID = -9215837473156146010L;
+
+ private String _redirectLocation;
+
+ public RedirectException(String redirectLocation)
+ {
+ this(null, redirectLocation);
+ }
+
+ /**
+ * @param message A message describing why the redirection is taking place.
+ * @param redirectLocation The location to redirect to, may be a relative path (relative
+ * to the {@link javax.servlet.ServletContext}).
+ *
+ * @see javax.servlet.http.HttpServletResponse#sendRedirect(String)
+ * @see javax.servlet.http.HttpServletResponse#encodeRedirectURL(String)
+ *
+ **/
+
+ public RedirectException(String message, String redirectLocation)
+ {
+ super(message);
+
+ _redirectLocation = redirectLocation;
+ }
+
+ public String getRedirectLocation()
+ {
+ return _redirectLocation;
+ }
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectFilter.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectFilter.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectFilter.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RedirectFilter.java Sat Mar 11 12:54:27 2006
@@ -47,10 +47,10 @@
public class RedirectFilter implements Filter
{
- public static final String REDIRECT_PATH_PARAM = "redirect-path";
-
private static final Log LOG = LogFactory.getLog(RedirectFilter.class);
+ public static final String REDIRECT_PATH_PARAM = "redirect-path";
+
private String _redirectPath;
public void init(FilterConfig config) throws ServletException
@@ -103,4 +103,4 @@
chain.doFilter(request, response);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RenderRewoundException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RenderRewoundException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RenderRewoundException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/RenderRewoundException.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,19 +17,19 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * A special subclass of {@link ApplicationRuntimeException} that can be thrown
- * when a component has determined that the state of the page has been rewound.
- *
+ * A special subclass of {@link ApplicationRuntimeException} that can be thrown
+ * when a component has determined that the state of the page has been
+ * rewound.
+ *
* @author Howard Lewis Ship
- */
+ **/
public class RenderRewoundException extends ApplicationRuntimeException
{
-
private static final long serialVersionUID = -4212602864703507206L;
- public RenderRewoundException(Object component)
+ public RenderRewoundException(Object component)
{
super(null, component, null, null);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleLinkException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleLinkException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleLinkException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleLinkException.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,39 +17,45 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * Exception thrown by an {@link org.apache.tapestry.engine.IEngineService} when
- * it discovers that the an action link was for an out-of-date version of the
- * page.
- * <p>
- * The application should redirect to the StaleLink page.
+ * Exception thrown by an {@link org.apache.tapestry.engine.IEngineService} when it discovers that
+ * the an action link was for an out-of-date version of the page.
+ *
+ * <p>The application should redirect to the StaleLink page.
+ *
+ *
+ * @author Howard Lewis Ship
*
- * @author Howard Lewis Ship
- */
+ **/
public class StaleLinkException extends ApplicationRuntimeException
{
-
private static final long serialVersionUID = -1266992401198999606L;
+
+ private transient IPage _page;
+ private String _pageName;
+ private String _targetIdPath;
+ private String _targetActionId;
- private final transient IPage _page;
- private final String _pageName;
- private final String _targetIdPath;
- private final String _targetActionId;
-
- // public StaleLinkException()
- // {
- // super(null, null, null, null);
- // }
+ public StaleLinkException()
+ {
+ super(null, null, null, null);
+ }
/**
- * Constructor used when the action id is found, but the target id path did
- * not match the actual id path.
- */
+ * Constructor used when the action id is found, but the target id path
+ * did not match the actual id path.
+ *
+ **/
public StaleLinkException(IComponent component, String targetActionId, String targetIdPath)
{
- super(Tapestry.format("StaleLinkException.action-mismatch", new String[] { targetActionId,
- component.getIdPath(), targetIdPath }), component, null, null);
+ super(
+ Tapestry.format(
+ "StaleLinkException.action-mismatch",
+ new String[] { targetActionId, component.getIdPath(), targetIdPath }),
+ component,
+ null,
+ null);
_page = component.getPage();
_pageName = _page.getPageName();
@@ -59,40 +65,46 @@
}
/**
- * Constructor used when the target action id is not found.
- */
+ * Constructor used when the target action id is not found.
+ *
+ **/
public StaleLinkException(IPage page, String targetActionId, String targetIdPath)
{
- this(Tapestry.format("StaleLinkException.component-mismatch", targetActionId, targetIdPath), page);
+ this(
+ Tapestry.format(
+ "StaleLinkException.component-mismatch",
+ targetActionId,
+ targetIdPath),
+ page);
+
+ _targetActionId = targetActionId;
+ _targetIdPath = targetIdPath;
}
public StaleLinkException(String message, IComponent component)
{
super(message, component, null, null);
-
- _targetActionId = null;
- _targetIdPath = null;
- _page = null;
- _pageName = null;
}
-
+
+
public String getPageName()
{
return _pageName;
}
/**
- * Returns the page referenced by the service URL, if known, or null
- * otherwise.
- */
+ * Returns the page referenced by the service URL, if known,
+ * or null otherwise.
+ *
+ **/
public IPage getPage()
{
return _page;
}
-
+
public String getTargetActionId()
{
return _targetActionId;
@@ -103,4 +115,4 @@
return _targetIdPath;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleSessionException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleSessionException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleSessionException.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/StaleSessionException.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,22 +17,24 @@
import org.apache.hivemind.ApplicationRuntimeException;
/**
- * Exception thrown by an {@link org.apache.tapestry.engine.IEngineService} when
- * it discovers that the {@link javax.servlet.http.HttpSession} has timed out
- * (and been replaced by a new, empty one).
- * <p>
- * The application should redirect to the stale-session page.
- *
- * @author Howard Lewis Ship
- */
+ * Exception thrown by an {@link org.apache.tapestry.engine.IEngineService} when it discovers that
+ * the {@link javax.servlet.http.HttpSession}
+ * has timed out (and been replaced by a new, empty
+ * one).
+ *
+ * <p>The application should redirect to the stale-session page.
+ *
+ *
+ * @author Howard Lewis Ship
+ *
+ **/
public class StaleSessionException extends ApplicationRuntimeException
{
-
private static final long serialVersionUID = 6733303549871198597L;
-
- private final transient IPage _page;
- private final String _pageName;
+
+ private transient IPage _page;
+ private String _pageName;
public StaleSessionException()
{
@@ -44,7 +46,8 @@
super(message, page, null, null);
_page = page;
- _pageName = (page == null) ? null : page.getPageName();
+ if (page != null)
+ _pageName = page.getPageName();
}
public String getPageName()
@@ -53,12 +56,12 @@
}
/**
- * Returns the page referenced by the service URL, if known, or null
- * otherwise.
- */
+ * Returns the page referenced by the service URL, if known, or null otherwise.
+ *
+ **/
public IPage getPage()
{
return _page;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Tapestry.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Tapestry.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Tapestry.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/Tapestry.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -39,8 +39,8 @@
import org.apache.tapestry.util.StringSplitter;
/**
- * A placeholder for a number of (static) methods that don't belong elsewhere,
- * as well as a global location for static constants.
+ * A placeholder for a number of (static) methods that don't belong elsewhere, as well as a global
+ * location for static constants.
*
* @since 1.0.1
* @author Howard Lewis Ship
@@ -48,77 +48,62 @@
public final class Tapestry
{
-
/**
- * The version of the framework; this is updated for major releases.
- */
-
- public static final String VERSION;
-
- /**
- * The name ("action") of a service that allows behavior to be associated
- * with an {@link IAction} component, such as
- * {@link org.apache.tapestry.link.ActionLink }or
+ * The name ("action") of a service that allows behavior to be associated with an
+ * {@link IAction} component, such as {@link org.apache.tapestry.link.ActionLink }or
* {@link org.apache.tapestry.form.Form}.
* <p>
- * This service is used with actions that are tied to the dynamic state of
- * the page, and which require a rewind of the page.
+ * 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 String ACTION_SERVICE = "action";
+ public final static String ACTION_SERVICE = "action";
/**
- * The name ("direct") of a service that allows stateless behavior for an
- * {@link org.apache.tapestry.link.DirectLink} component.
+ * The name ("direct") of a service that allows stateless behavior for an {@link
+ * org.apache.tapestry.link.DirectLink} component.
* <p>
- * 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.
+ * 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.
* <p>
- * An array of String parameters may be included with the service URL; these
- * will be made available to the {@link org.apache.tapestry.link.DirectLink}
- * component's listener.
+ * An array of String parameters may be included with the service URL; these will be made
+ * available to the {@link org.apache.tapestry.link.DirectLink} component's listener.
*/
- public static final String DIRECT_SERVICE = "direct";
+ public final static String DIRECT_SERVICE = "direct";
/**
- * The name ("external") of a service that a allows {@link IExternalPage} to
- * be selected. Associated with a
- * {@link org.apache.tapestry.link.ExternalLink} component.
+ * The name ("external") of a service that a allows {@link IExternalPage} to be selected.
+ * Associated with a {@link org.apache.tapestry.link.ExternalLink} component.
* <p>
- * This service enables {@link IExternalPage}s to be accessed via a URL.
- * External pages may be booked marked using their URL for future reference.
+ * This service enables {@link IExternalPage}s to be accessed via a URL. External pages may be
+ * booked marked using their URL for future reference.
* <p>
- * An array of Object parameters may be included with the service URL; these
- * will be passed to the
- * {@link IExternalPage#activateExternalPage(Object[], IRequestCycle)}
- * method.
+ * An array of Object parameters may be included with the service URL; these will be passed to
+ * the {@link IExternalPage#activateExternalPage(Object[], IRequestCycle)} method.
*/
- public static final String EXTERNAL_SERVICE = "external";
+ public final static String EXTERNAL_SERVICE = "external";
/**
- * The name ("page") of a service that allows a new page to be selected.
- * Associated with a {@link org.apache.tapestry.link.PageLink} component.
+ * The name ("page") of a service that allows a new page to be selected. Associated with a
+ * {@link org.apache.tapestry.link.PageLink} component.
* <p>
* The service requires a single parameter: the name of the target page.
*/
- public static final String PAGE_SERVICE = "page";
+ public final static String PAGE_SERVICE = "page";
/**
- * The name ("home") of a service that jumps to the home page. A stand-in
- * for when no service is provided, which is typically the entrypoint to the
- * application.
+ * The name ("home") of a service that jumps to the home page. A stand-in for when no service is
+ * provided, which is typically the entrypoint to the application.
*/
- public static final String HOME_SERVICE = "home";
+ public final static String HOME_SERVICE = "home";
/**
- * The name ("restart") of a service that invalidates the session and
- * restarts the application. Typically used just to recover from an
- * exception.
+ * The name ("restart") of a service that invalidates the session and restarts the application.
+ * Typically used just to recover from an exception.
*/
public static final String RESTART_SERVICE = "restart";
@@ -130,15 +115,13 @@
public static final String ASSET_SERVICE = "asset";
/**
- * The name ("reset") of a service used to clear cached template and
- * specification data and remove all pooled pages. This is only used when
- * debugging as a quick way to clear the out cached data, to allow updated
- * versions of specifications and templates to be loaded (without stopping
- * and restarting the servlet container).
+ * The name ("reset") of a service used to clear cached template and specification data and
+ * remove all pooled pages. This is only used when debugging as a quick way to clear the out
+ * cached data, to allow updated versions of specifications and templates to be loaded (without
+ * stopping and restarting the servlet container).
* <p>
* This service is only available if the Java system property
- * <code>org.apache.tapestry.enable-reset-service</code> is set to
- * <code>true</code>.
+ * <code>org.apache.tapestry.enable-reset-service</code> is set to <code>true</code>.
*/
public static final String RESET_SERVICE = "reset";
@@ -148,33 +131,30 @@
*
* @since 1.0.3
* @deprecated To be removed in 4.1. Use
- * {@link org.apache.tapestry.services.ServiceConstants#SERVICE}
- * instead.
+ * {@link org.apache.tapestry.services.ServiceConstants#SERVICE} instead.
*/
public static final String SERVICE_QUERY_PARAMETER_NAME = ServiceConstants.SERVICE;
/**
- * The query parameter for application specific parameters to the service
- * (this is used with the direct service). Each of these values is encoded
- * with {@link java.net.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).
+ * The query parameter for application specific parameters to the service (this is used with the
+ * direct service). Each of these values is encoded with
+ * {@link java.net.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).
*
* @since 1.0.3
* @deprecated To be removed in 4.1. Use
- * {@link org.apache.tapestry.services.ServiceConstants#PARAMETER}
- * instead.
+ * {@link org.apache.tapestry.services.ServiceConstants#PARAMETER} instead.
*/
public static final String PARAMETERS_QUERY_PARAMETER_NAME = ServiceConstants.PARAMETER;
/**
- * Property name used to get the extension used for templates. This may be
- * set in the page or component specification, or in the page (or
- * component's) immediate container (library or application specification).
- * Unlike most properties, value isn't inherited all the way up the chain.
- * The default template extension is "html".
+ * Property name used to get the extension used for templates. This may be set in the page or
+ * component specification, or in the page (or component's) immediate container (library or
+ * application specification). Unlike most properties, value isn't inherited all the way up the
+ * chain. The default template extension is "html".
*
* @since 3.0
*/
@@ -182,17 +162,16 @@
public static final String TEMPLATE_EXTENSION_PROPERTY = "org.apache.tapestry.template-extension";
/**
- * The name of an {@link org.apache.tapestry.IRequestCycle} attribute in
- * which the currently rendering
- * {@link org.apache.tapestry.components.ILinkComponent} is stored. Link
- * components do not nest.
+ * The name of an {@link org.apache.tapestry.IRequestCycle} attribute in which the currently
+ * rendering {@link org.apache.tapestry.components.ILinkComponent} is stored. Link components do
+ * not nest.
*/
public static final String LINK_COMPONENT_ATTRIBUTE_NAME = "org.apache.tapestry.active-link-component";
/**
- * Suffix appended to a parameter name to form the name of a property that
- * stores the binding for the parameter.
+ * Suffix appended to a parameter name to form the name of a property that stores the binding
+ * for the parameter.
*
* @since 3.0
*/
@@ -200,9 +179,8 @@
public static final String PARAMETER_PROPERTY_NAME_SUFFIX = "Binding";
/**
- * Key used to obtain an extension from the application specification. The
- * extension, if it exists, implements
- * {@link org.apache.tapestry.request.IRequestDecoder}.
+ * Key used to obtain an extension from the application specification. The extension, if it
+ * exists, implements {@link org.apache.tapestry.request.IRequestDecoder}.
*
* @since 2.2
*/
@@ -210,10 +188,9 @@
public static final String REQUEST_DECODER_EXTENSION_NAME = "org.apache.tapestry.request-decoder";
/**
- * Name of optional application extension for the multipart decoder used by
- * the application. The extension must implement
- * {@link org.apache.tapestry.multipart.IMultipartDecoder} (and is generally
- * a configured instance of
+ * Name of optional application extension for the multipart decoder used by the application. The
+ * extension must implement {@link org.apache.tapestry.multipart.IMultipartDecoder} (and is
+ * generally a configured instance of
* {@link org.apache.tapestry.multipart.DefaultMultipartDecoder}).
*
* @since 3.0
@@ -222,8 +199,7 @@
public static final String MULTIPART_DECODER_EXTENSION_NAME = "org.apache.tapestry.multipart-decoder";
/**
- * Method id used to check that {@link IPage#validate(IRequestCycle)} is
- * invoked.
+ * Method id used to check that {@link IPage#validate(IRequestCycle)} is invoked.
*
* @see #checkMethodInvocation(Object, String, Object)
* @since 3.0
@@ -241,10 +217,9 @@
public static final String ABSTRACTPAGE_DETACH_METHOD_ID = "AbstractPage.detach()";
/**
- * Regular expression defining a simple property name. Used by several
- * different parsers. Simple property names match Java variable names; a
- * leading letter (or underscore), followed by letters, numbers and
- * underscores.
+ * Regular expression defining a simple property name. Used by several different parsers. Simple
+ * property names match Java variable names; a leading letter (or underscore), followed by
+ * letters, numbers and underscores.
*
* @since 3.0
*/
@@ -253,8 +228,8 @@
/**
* Name of an application extension used as a factory for
- * {@link org.apache.tapestry.engine.IMonitor}instances. The extension must
- * implement {@link org.apache.tapestry.engine.IMonitorFactory}.
+ * {@link org.apache.tapestry.engine.IMonitor}instances. The extension must implement
+ * {@link org.apache.tapestry.engine.IMonitorFactory}.
*
* @since 3.0
*/
@@ -262,19 +237,24 @@
public static final String MONITOR_FACTORY_EXTENSION_NAME = "org.apache.tapestry.monitor-factory";
/**
- * Class name of an {@link ognl.TypeConverter}implementing class to use as
- * a type converter for
- * {@link org.apache.tapestry.binding.ExpressionBinding}.
+ * Class name of an {@link ognl.TypeConverter}implementing class to use as a type converter for
+ * {@link org.apache.tapestry.binding.ExpressionBinding}
*/
public static final String OGNL_TYPE_CONVERTER = "org.apache.tapestry.ognl-type-converter";
/**
- * Used for tracking if a particular super-class method has been invoked.
+ * Prevent instantiation.
*/
- private static final ThreadLocal INVOKED_METHOD_IDS_HOLDER = new ThreadLocal();
+ private Tapestry()
+ {
+ }
- private static final String UNKNOWN_VERSION = "Unknown";
+ /**
+ * The version of the framework; this is updated for major releases.
+ */
+
+ public static final String VERSION = readVersion();
/**
* Contains strings loaded from TapestryStrings.properties.
@@ -285,50 +265,46 @@
private static ResourceBundle _strings;
/**
- * A {@link Map}that links Locale names (as in {@link Locale#toString()}to
- * {@link Locale} instances. This prevents needless duplication of Locales.
+ * A {@link Map}that links Locale names (as in {@link Locale#toString()}to {@link Locale}
+ * instances. This prevents needless duplication of Locales.
*/
- private static final Map LOCALE_MAP = new HashMap();
+ private static final Map _localeMap = new HashMap();
static
{
- VERSION = readVersion();
-
Locale[] locales = Locale.getAvailableLocales();
- for(int i = 0; i < locales.length; i++)
+ for (int i = 0; i < locales.length; i++)
{
- LOCALE_MAP.put(locales[i].toString(), locales[i]);
+ _localeMap.put(locales[i].toString(), locales[i]);
}
}
/**
- * Prevent instantiation.
+ * Used for tracking if a particular super-class method has been invoked.
*/
- private Tapestry()
- {
- }
+ private static final ThreadLocal _invokedMethodIds = new ThreadLocal();
/**
- * Copys all informal {@link IBinding 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.
+ * Copys all informal {@link IBinding 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 void copyInformalBindings(IComponent source, IComponent destination)
{
Collection names = source.getBindingNames();
- if (names == null) return;
+ if (names == null)
+ return;
IComponentSpecification specification = source.getSpecification();
Iterator i = names.iterator();
- while(i.hasNext())
+ while (i.hasNext())
{
- String name = (String)i.next();
+ String name = (String) i.next();
// If not a formal parameter, then copy it over.
@@ -343,17 +319,17 @@
/**
* Gets the {@link Locale}for the given string, which is the result of
- * {@link Locale#toString()}. If no such locale is already registered, a
- * new instance is created, registered and returned.
+ * {@link Locale#toString()}. If no such locale is already registered, a new instance is
+ * created, registered and returned.
*/
public static Locale getLocale(String s)
{
Locale result = null;
- synchronized(LOCALE_MAP)
+ synchronized (_localeMap)
{
- result = (Locale)LOCALE_MAP.get(s);
+ result = (Locale) _localeMap.get(s);
}
if (result == null)
@@ -361,31 +337,31 @@
StringSplitter splitter = new StringSplitter('_');
String[] terms = splitter.splitToArray(s);
- switch(terms.length)
+ switch (terms.length)
{
- case 1:
+ case 1:
- result = new Locale(terms[0], "");
- break;
+ result = new Locale(terms[0], "");
+ break;
- case 2:
+ case 2:
- result = new Locale(terms[0], terms[1]);
- break;
+ result = new Locale(terms[0], terms[1]);
+ break;
- case 3:
+ case 3:
- result = new Locale(terms[0], terms[1], terms[2]);
- break;
+ result = new Locale(terms[0], terms[1], terms[2]);
+ break;
- default:
+ default:
- throw new IllegalArgumentException("Unable to convert '" + s + "' to a Locale.");
+ throw new IllegalArgumentException("Unable to convert '" + s + "' to a Locale.");
}
- synchronized(LOCALE_MAP)
+ synchronized (_localeMap)
{
- LOCALE_MAP.put(s, result);
+ _localeMap.put(s, result);
}
}
@@ -416,20 +392,21 @@
}
/**
- * Gets a string from the TapestryStrings resource bundle. The string in the
- * bundle is treated as a pattern for
- * {@link MessageFormat#format(java.lang.String, java.lang.Object[])}.
+ * Gets a string from the TapestryStrings resource bundle. The string in the bundle is treated
+ * as a pattern for {@link MessageFormat#format(java.lang.String, java.lang.Object[])}.
*
* @since 1.0.8
*/
public static String format(String key, Object[] args)
{
- if (_strings == null) _strings = ResourceBundle.getBundle("org.apache.tapestry.TapestryStrings");
+ if (_strings == null)
+ _strings = ResourceBundle.getBundle("org.apache.tapestry.TapestryStrings");
String pattern = _strings.getString(key);
- if (args == null) return pattern;
+ if (args == null)
+ return pattern;
return MessageFormat.format(pattern, args);
}
@@ -453,7 +430,8 @@
public static String format(String key, Object arg)
{
- return format(key, new Object[] { arg });
+ return format(key, new Object[]
+ { arg });
}
/**
@@ -464,7 +442,8 @@
public static String format(String key, Object arg1, Object arg2)
{
- return format(key, new Object[] { arg1, arg2 });
+ return format(key, new Object[]
+ { arg1, arg2 });
}
/**
@@ -475,14 +454,17 @@
public static String format(String key, Object arg1, Object arg2, Object arg3)
{
- return format(key, new Object[] { arg1, arg2, arg3 });
+ return format(key, new Object[]
+ { arg1, arg2, arg3 });
}
+ private static final String UNKNOWN_VERSION = "Unknown";
+
/**
* Invoked when the class is initialized to read the current version file.
*/
- private static String readVersion()
+ private static final String readVersion()
{
Properties props = new Properties();
@@ -490,7 +472,8 @@
{
InputStream in = Tapestry.class.getResourceAsStream("version.properties");
- if (in == null) return UNKNOWN_VERSION;
+ if (in == null)
+ return UNKNOWN_VERSION;
props.load(in);
@@ -513,7 +496,8 @@
public static int size(Collection c)
{
- if (c == null) return 0;
+ if (c == null)
+ return 0;
return c.size();
}
@@ -526,7 +510,8 @@
public static int size(Object[] array)
{
- if (array == null) return 0;
+ if (array == null)
+ return 0;
return array.length;
}
@@ -554,22 +539,21 @@
}
/**
- * Converts a {@link Map} to an even-sized array of key/value pairs. This
- * may be useful when using a Map as service parameters (with
- * {@link org.apache.tapestry.link.DirectLink}. Assuming the keys and
- * values are simple objects (String, Boolean, Integer, etc.), then the
+ * Converts a {@link Map} to an even-sized array of key/value pairs. This may be useful when
+ * using a Map as service parameters (with {@link org.apache.tapestry.link.DirectLink}.
+ * Assuming the keys and values are simple objects (String, Boolean, Integer, etc.), then the
* representation as an array will encode more efficiently (via
- * {@link org.apache.tapestry.util.io.DataSqueezerImpl} than serializing the
- * Map and its contents.
+ * {@link org.apache.tapestry.util.io.DataSqueezerImpl} than serializing the Map and its
+ * contents.
*
- * @return the array of keys and values, or null if the input Map is null or
- * empty
+ * @return the array of keys and values, or null if the input Map is null or empty
* @since 2.2
*/
public static Object[] convertMapToArray(Map map)
{
- if (isEmpty(map)) return null;
+ if (isEmpty(map))
+ return null;
Set entries = map.entrySet();
@@ -577,9 +561,9 @@
int x = 0;
Iterator i = entries.iterator();
- while(i.hasNext())
+ while (i.hasNext())
{
- Map.Entry entry = (Map.Entry)i.next();
+ Map.Entry entry = (Map.Entry) i.next();
result[x++] = entry.getKey();
result[x++] = entry.getValue();
@@ -598,14 +582,16 @@
public static Map convertArrayToMap(Object[] array)
{
- if (array == null || array.length == 0) return null;
+ if (array == null || array.length == 0)
+ return null;
- if (array.length % 2 != 0) throw new IllegalArgumentException(getMessage("Tapestry.even-sized-array"));
+ if (array.length % 2 != 0)
+ throw new IllegalArgumentException(getMessage("Tapestry.even-sized-array"));
Map result = new HashMap();
int x = 0;
- while(x < array.length)
+ while (x < array.length)
{
Object key = array[x++];
Object value = array[x++];
@@ -617,8 +603,8 @@
}
/**
- * Given a Class, creates a presentable name for the class, even if the
- * class is a scalar type or Array type.
+ * Given a Class, creates a presentable name for the class, even if the class is a scalar type
+ * or Array type.
*
* @since 3.0
* @deprecated To be removed in 4.1.
@@ -642,28 +628,31 @@
/** @since 3.0 * */
- public static ApplicationRuntimeException createNoSuchComponentException(IComponent component, String id,
- Location location)
+ public static ApplicationRuntimeException createNoSuchComponentException(IComponent component,
+ String id, Location location)
{
- return new ApplicationRuntimeException(format("no-such-component", component.getExtendedId(), id), component,
- location, null);
+ return new ApplicationRuntimeException(format("no-such-component", component
+ .getExtendedId(), id), component, location, null);
}
/** @since 3.0 * */
- public static BindingException createRequiredParameterException(IComponent component, String parameterName)
+ public static BindingException createRequiredParameterException(IComponent component,
+ String parameterName)
{
- return new BindingException(format("required-parameter", parameterName, component.getExtendedId()), component,
- null, component.getBinding(parameterName), null);
+ return new BindingException(format("required-parameter", parameterName, component
+ .getExtendedId()), component, null, component.getBinding(parameterName), null);
}
/** @since 3.0 * */
- public static ApplicationRuntimeException createRenderOnlyPropertyException(IComponent component,
- String propertyName)
+ public static ApplicationRuntimeException createRenderOnlyPropertyException(
+ IComponent component, String propertyName)
{
- return new ApplicationRuntimeException(format("render-only-property", propertyName, component.getExtendedId()),
- component, null, null);
+ return new ApplicationRuntimeException(format(
+ "render-only-property",
+ propertyName,
+ component.getExtendedId()), component, null, null);
}
/**
@@ -675,12 +664,12 @@
public static void clearMethodInvocations()
{
- INVOKED_METHOD_IDS_HOLDER.set(null);
+ _invokedMethodIds.set(null);
}
/**
- * Adds a method invocation to the list of invocations. This is done in a
- * super-class implementations.
+ * Adds a method invocation to the list of invocations. This is done in a super-class
+ * implementations.
*
* @see #checkMethodInvocation(Object, String, Object)
* @since 3.0
@@ -688,47 +677,46 @@
public static void addMethodInvocation(Object methodId)
{
- List methodIds = (List)INVOKED_METHOD_IDS_HOLDER.get();
+ List methodIds = (List) _invokedMethodIds.get();
if (methodIds == null)
{
methodIds = new ArrayList();
- INVOKED_METHOD_IDS_HOLDER.set(methodIds);
+ _invokedMethodIds.set(methodIds);
}
methodIds.add(methodId);
}
/**
- * Checks to see if a particular method has been invoked. The method is
- * identified by a methodId (usually a String). The methodName and object
- * are used to create an error message.
+ * Checks to see if a particular method has been invoked. The method is identified by a methodId
+ * (usually a String). The methodName and object are used to create an error message.
* <p>
- * The caller should invoke {@link #clearMethodInvocations()}, then invoke
- * a method on the object. The super-class implementation should invoke
- * {@link #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 caller should invoke {@link #clearMethodInvocations()}, then invoke a method on the
+ * object. The super-class implementation should invoke {@link #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.
* <p>
- * The list of method invocations is stored in a {@link ThreadLocal}
- * variable.
+ * The list of method invocations is stored in a {@link ThreadLocal} variable.
*
* @since 3.0
*/
public static void checkMethodInvocation(Object methodId, String methodName, Object object)
{
- List methodIds = (List)INVOKED_METHOD_IDS_HOLDER.get();
+ List methodIds = (List) _invokedMethodIds.get();
- if (methodIds != null && methodIds.contains(methodId)) return;
+ if (methodIds != null && methodIds.contains(methodId))
+ return;
- throw new ApplicationRuntimeException(Tapestry.format("Tapestry.missing-method-invocation", object.getClass()
- .getName(), methodName));
+ throw new ApplicationRuntimeException(Tapestry.format(
+ "Tapestry.missing-method-invocation",
+ object.getClass().getName(),
+ methodName));
}
/**
- * Method used by pages and components to send notifications about property
- * changes.
+ * Method used by pages and components to send notifications about property changes.
*
* @param component
* the component containing the property
@@ -742,7 +730,8 @@
{
ChangeObserver observer = component.getPage().getChangeObserver();
- if (observer == null) return;
+ if (observer == null)
+ return;
ObservedChangeEvent event = new ObservedChangeEvent(component, propertyName, newValue);
@@ -752,13 +741,12 @@
/**
* Returns true if the input is null or contains only whitespace.
* <p>
- * Note: Yes, you'd think we'd use <code>StringUtils</code>, but with the
- * change in names and behavior between releases, it is smarter to just
- * implement our own little method!
+ * Note: Yes, you'd think we'd use <code>StringUtils</code>, but with the change in names and
+ * behavior between releases, it is smarter to just implement our own little method!
*
* @since 3.0
- * @deprecated To be removed in Tapestry 4.1. Use
- * {@link HiveMind#isBlank(java.lang.String)} instead.
+ * @deprecated To be removed in Tapestry 4.1. Use {@link HiveMind#isBlank(java.lang.String)}
+ * instead.
*/
public static boolean isBlank(String input)
@@ -770,12 +758,12 @@
* Returns true if the input is not null and not empty (or only whitespace).
*
* @since 3.0
- * @deprecated To be removed in Tapestry 4.1. Use
- * {@link HiveMind#isNonBlank(java.lang.String)} instead.
+ * @deprecated To be removed in Tapestry 4.1. Use {@link HiveMind#isNonBlank(java.lang.String)}
+ * instead.
*/
public static boolean isNonBlank(String input)
{
return HiveMind.isNonBlank(input);
}
-}
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org