You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2007/11/13 22:34:54 UTC
svn commit: r594648 [1/4] - in /tapestry/tapestry5/trunk: ./
tapestry-core/src/main/java/org/apache/tapestry/
tapestry-core/src/main/java/org/apache/tapestry/annotations/
tapestry-core/src/main/java/org/apache/tapestry/corelib/components/
tapestry-core...
Author: hlship
Date: Tue Nov 13 13:34:47 2007
New Revision: 594648
URL: http://svn.apache.org/viewvc?rev=594648&view=rev
Log:
TAPESTRY-1748: Field validators continue to generate client-side JavaScript even though the Form is configured to not do client-side validation
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RunJetty.java
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentAction.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/FieldValidator.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Renderable.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Validator.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/AfterRenderBody.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderBody.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderTemplate.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Component.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixin.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/MixinClasses.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixins.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Retain.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/dom/Text.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/LiteralBindingFactory.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/events/InvalidationListener.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/ModelMessages.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/AttributeToken.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/BodyToken.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CDATAToken.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CommentToken.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/ExpansionToken.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/StartElementToken.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TemplateToken.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TextToken.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClassResultProcessor.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassTransformer.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ConstructorArg.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EnvironmentalShadowBuilderImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorSourceImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/Instantiator.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MethodCompileException.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/MixinWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PersistentFieldBundleImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ReflectiveInstantiator.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/RetainWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/UpdateListenerHub.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentCallback.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ExpansionPageElement.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/StartElementPageElement.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/TextPageElement.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/test/CodeEq.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64InputStream.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64ObjectOutputStream.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/Base64OutputStream.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/IntegerRange.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/ParameterBuilder.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/util/StringParameterBuilder.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/EmbeddedComponentModel.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/model/MutableEmbeddedComponentModel.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/ComponentResourcesAware.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/runtime/RenderCommand.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationInitializer.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationInitializerFilter.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentClassTransformWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ExceptionReporter.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/FormSupport.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/HttpServletRequestFilter.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/HttpServletRequestHandler.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/LibraryMapping.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/MarkupWriterFactory.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/PersistentFieldBundle.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/PersistentFieldChange.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/PersistentFieldStrategy.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/RequestExceptionHandler.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/RequestGlobals.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ServletApplicationInitializer.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ServletApplicationInitializerFilter.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TransformUtils.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/validator/Max.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/validator/MaxLength.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/validator/Min.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/validator/MinLength.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/validator/Regexp.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/validator/Required.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js
tapestry/tapestry5/trunk/tapestry-core/src/site/site.xml
tapestry/tapestry5/trunk/tapestry-core/src/test/conf/webdefault.xml
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/internal/FormSupportImplTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ReturnTypes.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/bindings/StringHolder.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/FieldValidatorSourceImplTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/FooInterface.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/GetterMethodsInterface.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/Named.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ParameterComponent.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ParserExperiment.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PersistentFieldBundleImplTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/VisibilityBean.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/test/PageTesterSessionTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/transform/pages/AbstractFoo.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/transform/pages/BarImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/transform/pages/ChildClassInheritsAnnotation.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/transform/pages/FooImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/transform/pages/TargetObject.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/transform/pages/TargetObjectSubclass.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/util/Base64Tests.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/util/MethodInvocationBuilderTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/services/SyncCostBench.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/services/TransformUtilsTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/util/FindTheParameterizedType.java
tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry/test/AbstractIntegrationTestSuite.java
tapestry/tapestry5/trunk/tapestry5.ipr
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentAction.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentAction.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentAction.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentAction.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry;
import java.io.Serializable;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/FieldValidator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/FieldValidator.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/FieldValidator.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/FieldValidator.java Tue Nov 13 13:34:47 2007
@@ -34,7 +34,7 @@
/**
* Invokes
- * {@link Validator#render(Field, Object, org.apache.tapestry.ioc.MessageFormatter, MarkupWriter, PageRenderSupport)}.
+ * {@link Validator#render(Field,C,org.apache.tapestry.ioc.MessageFormatter, MarkupWriter, PageRenderSupport,org.apache.tapestry.services.FormSupport)}.
*
* @param writer
*/
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Renderable.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Renderable.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Renderable.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Renderable.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry;
/**
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryFilter.java Tue Nov 13 13:34:47 2007
@@ -64,8 +64,7 @@
SymbolProvider provider = new ServletContextSymbolProvider(context);
- TapestryAppInitializer appInitializer = new TapestryAppInitializer(provider, filterName,
- "servlet");
+ TapestryAppInitializer appInitializer = new TapestryAppInitializer(provider, filterName, "servlet");
appInitializer.addModules(provideExtraModuleDefs(context));
@@ -75,17 +74,14 @@
long toRegistry = appInitializer.getRegistryCreatedTime();
- ServletApplicationInitializer ai = _registry.getService(
- "ServletApplicationInitializer",
- ServletApplicationInitializer.class);
+ ServletApplicationInitializer ai = _registry.getService("ServletApplicationInitializer",
+ ServletApplicationInitializer.class);
ai.initializeApplication(filterConfig.getServletContext());
_registry.performRegistryStartup();
- _handler = _registry.getService(
- "HttpServletRequestHandler",
- HttpServletRequestHandler.class);
+ _handler = _registry.getService("HttpServletRequestHandler", HttpServletRequestHandler.class);
init(_registry);
@@ -94,8 +90,8 @@
StringBuilder buffer = new StringBuilder("Startup status:\n\n");
Formatter f = new Formatter(buffer);
- f.format("Startup time: %,d ms to build IoC Registry, %,d ms overall."
- + "\n\nStartup services status:\n", toRegistry - start, toFinish - start);
+ f.format("Startup time: %,d ms to build IoC Registry, %,d ms overall." + "\n\nStartup services status:\n",
+ toRegistry - start, toFinish - start);
int unrealized = 0;
@@ -104,21 +100,31 @@
List<ServiceActivity> serviceActivity = scoreboard.getServiceActivity();
+ int longest = 0;
+
+ // One pass to find the longest name, and to count the unrealized services.
+
for (ServiceActivity activity : serviceActivity)
{
Status status = activity.getStatus();
- f.format("%40s: %s\n", activity.getServiceId(), status.name());
+ longest = Math.max(longest, activity.getServiceId().length());
if (status == Status.DEFINED || status == Status.VIRTUAL) unrealized++;
}
- f.format(
- "\n%d/%d unrealized services (%4.2f%%)\n",
- unrealized,
- serviceActivity.size(),
- 100. * unrealized / serviceActivity.size());
+ String formatString = "%" + longest + "s: %s\n";
+
+ // A second pass to output all the services
+
+ for (ServiceActivity activity : serviceActivity)
+ {
+ f.format(formatString, activity.getServiceId(), activity.getStatus().name());
+ }
+
+ f.format("\n%4.2f%% unrealized services (%d/%d)\n", 100. * unrealized / serviceActivity.size(), unrealized,
+ serviceActivity.size());
_logger.info(buffer.toString());
}
@@ -155,9 +161,7 @@
{
try
{
- boolean handled = _handler.service(
- (HttpServletRequest) request,
- (HttpServletResponse) response);
+ boolean handled = _handler.service((HttpServletRequest) request, (HttpServletResponse) response);
if (!handled) chain.doFilter(request, response);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Validator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Validator.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Validator.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/Validator.java Tue Nov 13 13:34:47 2007
@@ -15,6 +15,7 @@
package org.apache.tapestry;
import org.apache.tapestry.ioc.MessageFormatter;
+import org.apache.tapestry.services.FormSupport;
import org.apache.tapestry.services.ValidationMessagesSource;
/**
@@ -61,8 +62,7 @@
* @param value the translated value supplied by the user
* @throws ValidationException if the value violates the constraint
*/
- void validate(Field field, C constraintValue, MessageFormatter formatter, T value)
- throws ValidationException;
+ void validate(Field field, C constraintValue, MessageFormatter formatter, T value) throws ValidationException;
/**
* Returns true if the validator should be invoked for null or blank (empty string) values. This
@@ -74,13 +74,13 @@
* Hook used by components to allow the validator to contribute additional attribute or (more
* often) client-side JavaScript (via the {@link PageRenderSupport}).
*
- * @param field the field which is currently being rendered
- * @param constraintValue the value used to constrain input
- * @param formatter validation message, in the appropriate locale
- * @param writer markup writer, allowing additional attributes to be written into the active
- * element
- * @param pageRenderSupport used to generate client-side JavaScript to support validation
+ * @param field the field which is currently being rendered
+ * @param constraintValue the value used to constrain input
+ * @param formatter validation message, in the appropriate locale
+ * @param writer markup writer, allowing additional attributes to be written into the active
+ * element
+ * @param formSupport
*/
void render(Field field, C constraintValue, MessageFormatter formatter, MarkupWriter writer,
- PageRenderSupport pageRenderSupport);
+ FormSupport formSupport);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/AfterRenderBody.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/AfterRenderBody.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/AfterRenderBody.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/AfterRenderBody.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006, 2007 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006, 2007 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.annotations;
import java.lang.annotation.Documented;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderBody.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderBody.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderBody.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderBody.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.annotations;
import java.lang.annotation.Documented;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderTemplate.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderTemplate.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderTemplate.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/BeforeRenderTemplate.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.annotations;
import java.lang.annotation.Documented;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Component.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Component.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Component.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Component.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.annotations;
import java.lang.annotation.Documented;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixin.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixin.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixin.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixin.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006, 2007 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006, 2007 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.annotations;
import java.lang.annotation.Documented;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/MixinClasses.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/MixinClasses.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/MixinClasses.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/MixinClasses.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.annotations;
import java.lang.annotation.Documented;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixins.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixins.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixins.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Mixins.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.annotations;
import java.lang.annotation.Documented;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Retain.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Retain.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Retain.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/annotations/Retain.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.annotations;
import java.lang.annotation.Documented;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java Tue Nov 13 13:34:47 2007
@@ -190,12 +190,12 @@
_formSupport = new FormSupportImpl(_name, _actions);
// TODO: Forms should not allow to nest. Perhaps a set() method instead of a push() method
- // for this kind of check?
+ // for this kind of check?
_environment.push(FormSupport.class, _formSupport);
_environment.push(ValidationTracker.class, _tracker);
// Now that the environment is setup, inform the component or other listeners that the form
- // is about to render.
+ // is about to render.
Object[] contextArray = _context == null ? new Object[0] : _context.toArray();
@@ -222,9 +222,6 @@
writer.end(); // div
- if (_clientValidation)
- _pageRenderSupport.addScript(format("Tapestry.registerForm('%s');", _name));
-
_environment.peek(Heartbeat.class).begin();
}
@@ -235,6 +232,14 @@
_formSupport.executeDeferred();
+ if (_clientValidation)
+ {
+ // The validations are a JSON object that doesn't need to be enclosed in quotes.
+ // Invoking addScript() will add in the default JavaScript (prototype, scriptaculous, tapestry.js).
+ _pageRenderSupport.addScript(
+ format("Tapestry.registerForm('%s', %s);", _name, _formSupport.getValidations()));
+ }
+
String encodingType = _formSupport.getEncodingType();
if (encodingType != null) _form.forceAttributes("enctype", encodingType);
@@ -288,15 +293,11 @@
ComponentEventHandler handler = new ComponentEventHandler()
{
- public boolean handleResult(Object result, Component component,
- String methodDescription)
+ public boolean handleResult(Object result, Component component, String methodDescription)
{
if (result instanceof Boolean) return ((Boolean) result);
- holder.put(_eventResultProcessor.processComponentEvent(
- result,
- component,
- methodDescription));
+ holder.put(_eventResultProcessor.processComponentEvent(result, component, methodDescription));
return true; // Abort other event processing.
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/internal/FormSupportImpl.java Tue Nov 13 13:34:47 2007
@@ -15,9 +15,12 @@
package org.apache.tapestry.corelib.internal;
import org.apache.tapestry.ComponentAction;
+import org.apache.tapestry.Field;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
import static org.apache.tapestry.ioc.internal.util.Defense.*;
import org.apache.tapestry.ioc.internal.util.IdAllocator;
+import org.apache.tapestry.json.JSONArray;
+import org.apache.tapestry.json.JSONObject;
import org.apache.tapestry.runtime.Component;
import org.apache.tapestry.services.FormSupport;
@@ -40,6 +43,9 @@
private final ObjectOutputStream _actions;
+ private final JSONObject _validations = new JSONObject();
+
+
private List<Runnable> _commands;
private String _encodingType;
@@ -82,9 +88,7 @@
}
catch (IOException ex)
{
- throw new RuntimeException(InternalMessages.componentActionNotSerializable(
- completeId,
- ex), ex);
+ throw new RuntimeException(InternalMessages.componentActionNotSerializable(completeId, ex), ex);
}
}
@@ -127,11 +131,46 @@
notBlank(encodingType, "encodingType");
if (_encodingType != null && !_encodingType.equals(encodingType))
- throw new IllegalStateException(InternalMessages.conflictingEncodingType(
- _encodingType,
- encodingType));
+ throw new IllegalStateException(InternalMessages.conflictingEncodingType(_encodingType, encodingType));
_encodingType = encodingType;
+ }
+
+ public void addValidation(Field field, String validationName, String message, Object constraint)
+ {
+ String fieldId = field.getClientId();
+
+ JSONArray specs = null;
+
+ if (_validations.has(fieldId)) specs = _validations.getJSONArray(fieldId);
+ else
+ {
+ specs = new JSONArray();
+ _validations.put(fieldId, specs);
+ }
+
+ JSONArray thisSpec = new JSONArray();
+
+ thisSpec.put(validationName);
+ thisSpec.put(message);
+
+ if (constraint != null) thisSpec.put(constraint);
+
+ specs.put(thisSpec);
+ }
+
+ /**
+ * Returns the combined validation data collected via {@link #addValidation(org.apache.tapestry.Field, String, String, Object)}.
+ * The keys of this object are the client ids of the {@link org.apache.tapestry.Field}s, the values
+ * are an array of validation specifications for that field. Each validation specification is itself
+ * an array of two or three values: the validation name (i.e., a method of the client-side Tapestry.Validation
+ * object), the message if the field is invalid and, optionally, the constraint value.
+ *
+ * @return the validation object
+ */
+ public JSONObject getValidations()
+ {
+ return _validations;
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/dom/Text.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/dom/Text.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/dom/Text.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/dom/Text.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.dom;
import java.io.PrintWriter;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/LiteralBindingFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/LiteralBindingFactory.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/LiteralBindingFactory.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/LiteralBindingFactory.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.bindings;
import org.apache.tapestry.Binding;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/events/InvalidationListener.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/events/InvalidationListener.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/events/InvalidationListener.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/events/InvalidationListener.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006, 2007 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006, 2007 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.events;
/**
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/ModelMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/ModelMessages.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/ModelMessages.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/ModelMessages.java Tue Nov 13 13:34:47 2007
@@ -30,14 +30,9 @@
return MESSAGES.format("duplicate-parameter", parameterName, componentName);
}
- static String duplicateParameterValue(String parameterName, String componentId,
- String componentClassName)
+ static String duplicateParameterValue(String parameterName, String componentId, String componentClassName)
{
- return MESSAGES.format(
- "duplicate-parameter-value",
- parameterName,
- componentId,
- componentClassName);
+ return MESSAGES.format("duplicate-parameter-value", parameterName, componentId, componentClassName);
}
static String duplicateComponentId(String id, String componentClassName)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/AttributeToken.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/AttributeToken.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/AttributeToken.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/AttributeToken.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.parser;
import org.apache.tapestry.ioc.Location;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/BodyToken.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/BodyToken.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/BodyToken.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/BodyToken.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.parser;
import org.apache.tapestry.ioc.Location;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CDATAToken.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CDATAToken.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CDATAToken.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CDATAToken.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.parser;
import org.apache.tapestry.ioc.Location;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CommentToken.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CommentToken.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CommentToken.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/CommentToken.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.parser;
import org.apache.tapestry.ioc.Location;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/ExpansionToken.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/ExpansionToken.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/ExpansionToken.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/ExpansionToken.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.parser;
import org.apache.tapestry.ioc.Location;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/StartElementToken.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/StartElementToken.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/StartElementToken.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/StartElementToken.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.parser;
import org.apache.tapestry.ioc.Location;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TemplateToken.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TemplateToken.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TemplateToken.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TemplateToken.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.parser;
import org.apache.tapestry.ioc.BaseLocatable;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TextToken.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TextToken.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TextToken.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/parser/TextToken.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.parser;
import org.apache.tapestry.ioc.Location;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClassResultProcessor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClassResultProcessor.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClassResultProcessor.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClassResultProcessor.java Tue Nov 13 13:34:47 2007
@@ -43,8 +43,7 @@
_linkFactory = linkFactory;
}
- public ActionResponseGenerator processComponentEvent(Class value, Component component,
- String methodDescripion)
+ public ActionResponseGenerator processComponentEvent(Class value, Component component, String methodDescripion)
{
String className = value.getName();
String pageName = _resolver.resolvePageClassNameToPageName(className);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassTransformer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassTransformer.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassTransformer.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentClassTransformer.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.services;
import javassist.CtClass;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ConstructorArg.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ConstructorArg.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ConstructorArg.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ConstructorArg.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.services;
import javassist.CtClass;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EnvironmentalShadowBuilderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EnvironmentalShadowBuilderImpl.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EnvironmentalShadowBuilderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EnvironmentalShadowBuilderImpl.java Tue Nov 13 13:34:47 2007
@@ -34,8 +34,7 @@
/**
* Construct using the default builtin factory, not the component layer version.
*/
- public EnvironmentalShadowBuilderImpl(@Builtin
- ClassFactory classFactory,
+ public EnvironmentalShadowBuilderImpl(@Builtin ClassFactory classFactory,
Environment environment)
{
@@ -70,16 +69,14 @@
classFab.addField("_environment", Environment.class);
classFab.addField("_serviceType", Class.class);
- classFab.addConstructor(new Class[]
- {Environment.class, Class.class}, null, "{ _environment = $1; _serviceType = $2; }");
+ classFab.addConstructor(new Class[]{Environment.class, Class.class}, null,
+ "{ _environment = $1; _serviceType = $2; }");
- classFab.addMethod(Modifier.PRIVATE, new MethodSignature(serviceType, "_delegate", null,
- null),
+ classFab.addMethod(Modifier.PRIVATE, new MethodSignature(serviceType, "_delegate", null, null),
"return ($r) _environment.peekRequired(_serviceType); ");
- classFab.proxyMethodsToDelegate(serviceType, "_delegate()", format(
- "<EnvironmentalProxy for %s>",
- serviceType.getName()));
+ classFab.proxyMethodsToDelegate(serviceType, "_delegate()",
+ format("<EnvironmentalProxy for %s>", serviceType.getName()));
return classFab.createClass();
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorImpl.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorImpl.java Tue Nov 13 13:34:47 2007
@@ -16,6 +16,7 @@
import org.apache.tapestry.*;
import org.apache.tapestry.ioc.MessageFormatter;
+import org.apache.tapestry.services.FormSupport;
public class FieldValidatorImpl implements FieldValidator
{
@@ -27,27 +28,24 @@
private final Validator _validator;
- private final PageRenderSupport _pageRenderSupport;
+ private final FormSupport _formSupport;
- public FieldValidatorImpl(Field field, Object constraintValue,
- MessageFormatter messageFormatter, Validator validator,
- PageRenderSupport pageRenderSupport)
+ public FieldValidatorImpl(Field field, Object constraintValue, MessageFormatter messageFormatter,
+ Validator validator, FormSupport formSupport)
{
_field = field;
_constraintValue = constraintValue;
_messageFormatter = messageFormatter;
_validator = validator;
- _pageRenderSupport = pageRenderSupport;
+ _formSupport = formSupport;
}
@SuppressWarnings("unchecked")
public void validate(Object value) throws ValidationException
{
- if (!_validator.invokeIfBlank() && isBlank(value))
- return;
+ if (!_validator.invokeIfBlank() && isBlank(value)) return;
- if (value != null && !_validator.getValueType().isInstance(value))
- return;
+ if (value != null && !_validator.getValueType().isInstance(value)) return;
_validator.validate(_field, _constraintValue, _messageFormatter, value);
}
@@ -55,9 +53,7 @@
@SuppressWarnings("unchecked")
public void render(MarkupWriter writer)
{
- // TODO: Skip this step if the Form's clientValidation parameter is false?
-
- _validator.render(_field, _constraintValue, _messageFormatter, writer, _pageRenderSupport);
+ _validator.render(_field, _constraintValue, _messageFormatter, writer, _formSupport);
}
private boolean isBlank(Object value)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorSourceImpl.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/FieldValidatorSourceImpl.java Tue Nov 13 13:34:47 2007
@@ -14,7 +14,10 @@
package org.apache.tapestry.internal.services;
-import org.apache.tapestry.*;
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.Field;
+import org.apache.tapestry.FieldValidator;
+import org.apache.tapestry.Validator;
import org.apache.tapestry.ioc.MessageFormatter;
import org.apache.tapestry.ioc.Messages;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
@@ -24,6 +27,7 @@
import org.apache.tapestry.ioc.services.TypeCoercer;
import org.apache.tapestry.runtime.Component;
import org.apache.tapestry.services.FieldValidatorSource;
+import org.apache.tapestry.services.FormSupport;
import org.apache.tapestry.services.ValidationMessagesSource;
import java.util.List;
@@ -38,15 +42,14 @@
private final TypeCoercer _typeCoercer;
- private final PageRenderSupport _pageRenderSupport;
+ private final FormSupport _formSupport;
- public FieldValidatorSourceImpl(ValidationMessagesSource messagesSource,
- TypeCoercer typeCoercer, PageRenderSupport pageRenderSupport,
- Map<String, Validator> validators)
+ public FieldValidatorSourceImpl(ValidationMessagesSource messagesSource, TypeCoercer typeCoercer,
+ FormSupport formSupport, Map<String, Validator> validators)
{
_messagesSource = messagesSource;
_typeCoercer = typeCoercer;
- _pageRenderSupport = pageRenderSupport;
+ _formSupport = formSupport;
_validators = validators;
}
@@ -64,27 +67,18 @@
Messages overrideMessages = componentResources.getContainerMessages();
- return createValidator(
- field,
- validatorType,
- constraintValue,
- overrideId,
- overrideMessages,
- locale);
+ return createValidator(field, validatorType, constraintValue, overrideId, overrideMessages, locale);
}
- public FieldValidator createValidator(Field field, String validatorType,
- String constraintValue, String overrideId, Messages overrideMessages,
- Locale locale)
+ public FieldValidator createValidator(Field field, String validatorType, String constraintValue, String overrideId,
+ Messages overrideMessages, Locale locale)
{
notBlank(validatorType, "validatorType");
Validator validator = _validators.get(validatorType);
- if (validator == null)
- throw new IllegalArgumentException(ServicesMessages.unknownValidatorType(
- validatorType,
- InternalUtils.sortedKeys(_validators)));
+ if (validator == null) throw new IllegalArgumentException(
+ ServicesMessages.unknownValidatorType(validatorType, InternalUtils.sortedKeys(_validators)));
// I just have this thing about always treating parameters as finals, so
// we introduce a second variable to treat a mutable.
@@ -98,36 +92,27 @@
{
String key = overrideId + "-" + validatorType;
- if (overrideMessages.contains(key))
- finalConstraintValue = overrideMessages.get(key);
- else
- throw new IllegalArgumentException(ServicesMessages.missingValidatorConstraint(
- validatorType,
- validator.getConstraintType()));
+ if (overrideMessages.contains(key)) finalConstraintValue = overrideMessages.get(key);
+ else throw new IllegalArgumentException(
+ ServicesMessages.missingValidatorConstraint(validatorType, validator.getConstraintType()));
}
Object coercedConstraintValue = coerceConstraintValue(finalConstraintValue, validator
.getConstraintType());
- MessageFormatter formatter = findMessageFormatter(
- overrideId,
- overrideMessages,
- locale,
- validatorType,
- validator);
+ MessageFormatter formatter = findMessageFormatter(overrideId, overrideMessages, locale, validatorType,
+ validator);
- return new FieldValidatorImpl(field, coercedConstraintValue, formatter, validator,
- _pageRenderSupport);
+ return new FieldValidatorImpl(field, coercedConstraintValue, formatter, validator, _formSupport);
}
- private MessageFormatter findMessageFormatter(String overrideId, Messages overrideMessages,
- Locale locale, String validatorType, Validator validator)
+ private MessageFormatter findMessageFormatter(String overrideId, Messages overrideMessages, Locale locale,
+ String validatorType, Validator validator)
{
String overrideKey = overrideId + "-" + validatorType + "-message";
- if (overrideMessages.contains(overrideKey))
- return overrideMessages.getFormatter(overrideKey);
+ if (overrideMessages.contains(overrideKey)) return overrideMessages.getFormatter(overrideKey);
Messages messages = _messagesSource.getValidationMessages(locale);
@@ -193,8 +178,6 @@
COMMA
}
- ;
-
static List<ValidatorSpecification> parse(String specification)
{
List<ValidatorSpecification> result = newList();
@@ -345,8 +328,6 @@
private static void parseError(int cursor, String specification)
{
- throw new RuntimeException(ServicesMessages.validatorSpecificationParseError(
- cursor,
- specification));
+ throw new RuntimeException(ServicesMessages.validatorSpecificationParseError(cursor, specification));
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/Instantiator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/Instantiator.java?rev=594648&r1=594647&r2=594648&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/Instantiator.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/Instantiator.java Tue Nov 13 13:34:47 2007
@@ -1,17 +1,17 @@
-// Copyright 2006 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.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.internal.services;
import org.apache.tapestry.internal.InternalComponentResources;