tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r1196382 - in /tapestry/tapestry5/trunk/tapestry-core/src/main: java/org/apache/tapestry5/internal/pageload/ resources/org/apache/tapestry5/internal/pageload/
Date Tue, 01 Nov 2011 23:12:44 GMT
Author: hlship
Date: Tue Nov  1 23:12:44 2011
New Revision: 1196382

URL: http://svn.apache.org/viewvc?rev=1196382&view=rev
Log:
Remove class PageloadMessages

Removed:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageloadMessages.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/pageload/PageloadStrings.properties
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/ComponentAssemblerImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/CompositeRenderCommand.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/EmbeddedComponentAssemblerImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageAssembly.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/TokenStreamImpl.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/ComponentAssemblerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/ComponentAssemblerImpl.java?rev=1196382&r1=1196381&r2=1196382&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/ComponentAssemblerImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/ComponentAssemblerImpl.java
Tue Nov  1 23:12:44 2011
@@ -134,8 +134,7 @@ class ComponentAssemblerImpl implements 
             return pageAssembly.createdElement.peek();
         } catch (RuntimeException ex)
         {
-            throw new RuntimeException(PageloadMessages.exceptionAssemblingRootComponent(pageAssembly.page.getName(),
-                    InternalUtils.toMessage(ex)), ex);
+            throw new RuntimeException(String.format("Exception assembling root component
of page %s: %s", pageAssembly.page.getName(), InternalUtils.toMessage(ex)), ex);
         }
     }
 
@@ -193,8 +192,11 @@ class ComponentAssemblerImpl implements 
                     pageAssembly.componentName.pop();
                 } catch (RuntimeException ex)
                 {
-                    throw new TapestryException(PageloadMessages.exceptionAssemblingEmbeddedComponent(embeddedId,
-                            componentClassName, container.getCompleteId(), InternalUtils.toMessage(ex)),
location, ex);
+                    throw new TapestryException(String.format("Exception assembling embedded
component '%s' (of type %s, within %s): %s",
+                            embeddedId,
+                            componentClassName,
+                            container.getCompleteId(),
+                            InternalUtils.toMessage(ex)), location, ex);
                 }
             }
         });
@@ -264,8 +266,10 @@ class ComponentAssemblerImpl implements 
 
             String className = getModel().getComponentClassName();
 
-            throw new RuntimeException(PageloadMessages.embeddedComponentsNotInTemplate(
-                    InternalUtils.joinSorted(embeddedIds.keySet()), className, InternalUtils.lastTerm(className),
+            throw new RuntimeException(String.format("Embedded component(s) %s are defined
within component class %s (or a super-class of %s), but are not present in the component template
(%s).",
+                    InternalUtils.joinSorted(embeddedIds.keySet()),
+                    className,
+                    InternalUtils.lastTerm(className),
                     templateResource));
         }
     }
@@ -294,7 +298,7 @@ class ComponentAssemblerImpl implements 
             if (InternalUtils.isBlank(componentClassName))
             {
                 throw new TapestryException(
-                        PageloadMessages.missingComponentType(), location, null);
+                        "You must specify the type via t:type, the element, or @Component
annotation.", location, null);
             }
 
             EmbeddedComponentAssemblerImpl embedded = new EmbeddedComponentAssemblerImpl(assemblerSource,
@@ -318,8 +322,12 @@ class ComponentAssemblerImpl implements 
                     if (existingEmbeddedId != null)
                     {
                         throw new TapestryException(
-                                PageloadMessages.parameterAlreadyPublished(publishedParameterName,
embeddedId, instantiator
-                                        .getModel().getComponentClassName(), existingEmbeddedId),
location, null);
+                                String.format("Parameter '%s' of embedded component '%s'
can not be published as a parameter of component %s, as it has previously been published by
embedded component '%s'.",
+                                        publishedParameterName,
+                                        embeddedId,
+                                        instantiator
+                                                .getModel().getComponentClassName(),
+                                        existingEmbeddedId), location, null);
                     }
 
                     publishedParameterToEmbeddedId.put(publishedParameterName, embeddedId);
@@ -330,7 +338,7 @@ class ComponentAssemblerImpl implements 
             return embedded;
         } catch (Exception ex)
         {
-            throw new TapestryException(PageloadMessages.failureCreatingEmbeddedComponent(embeddedId,
instantiator
+            throw new TapestryException(String.format("Failure creating embedded component
'%s' of %s: %s", embeddedId, instantiator
                     .getModel().getComponentClassName(), InternalUtils.toMessage(ex)), location,
ex);
         }
     }
@@ -373,7 +381,9 @@ class ComponentAssemblerImpl implements 
 
         if (innerBinder == null)
         {
-            String message = PageloadMessages.publishedParameterNonexistant(parameterName,
instantiator.getModel()
+            String message = String.format("Parameter '%s' of component %s is improperly
published from embedded component '%s' " +
+                    "(where it does not exist). This may be a typo in the publishParameters
attribute of " +
+                    "the @Component annotation.", parameterName, instantiator.getModel()
                     .getComponentClassName(), embeddedId);
 
             throw new TapestryException(message, embededdedComponentAssembler.getLocation(),
null);

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/CompositeRenderCommand.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/CompositeRenderCommand.java?rev=1196382&r1=1196381&r2=1196382&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/CompositeRenderCommand.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/CompositeRenderCommand.java
Tue Nov  1 23:12:44 2011
@@ -1,4 +1,4 @@
-// Copyright 2008, 2009 The Apache Software Foundation
+// Copyright 2008, 2009, 2011 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.
@@ -49,7 +49,7 @@ class CompositeRenderCommand implements 
         private void nyi(String methodName)
         {
             throw new IllegalStateException(
-                    PageloadMessages.compositeRenderCommandMethodNotImplemented(methodName));
+                    String.format("RenderQueue method %s() is not implemented for composited
render commands.", methodName));
         }
     };
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/EmbeddedComponentAssemblerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/EmbeddedComponentAssemblerImpl.java?rev=1196382&r1=1196381&r2=1196382&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/EmbeddedComponentAssemblerImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/EmbeddedComponentAssemblerImpl.java
Tue Nov  1 23:12:44 2011
@@ -167,7 +167,7 @@ public class EmbeddedComponentAssemblerI
         String mixinId = InternalUtils.lastTerm(className);
 
         if (mixinIdToInstantiator.containsKey(mixinId))
-            throw new TapestryException(PageloadMessages.uniqueMixinRequired(mixinId), location,
null);
+            throw new TapestryException(String.format("Mixins applied to a component must
be unique. Mixin '%s' has already been applied.", mixinId), location, null);
 
         mixinIdToInstantiator.put(mixinId, mixinInstantiator);
         mixinsIdToOrderConstraints.put(mixinId, order);

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageAssembly.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageAssembly.java?rev=1196382&r1=1196381&r2=1196382&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageAssembly.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageAssembly.java
Tue Nov  1 23:12:44 2011
@@ -95,7 +95,7 @@ class PageAssembly
             if (e.getComponentResources().getComponentModel().getComponentClassName().equals(componentClassName))
             {
                 throw new TapestryException(
-                        PageloadMessages.recursiveTemplate(componentClassName),
+                        String.format("The template for component %s is recursive (contains
another direct or indirect reference to component %<s). This is not supported (components
may not contain themselves).", componentClassName),
                         location,
                         null);
             }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java?rev=1196382&r1=1196381&r2=1196382&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/PageLoaderImpl.java
Tue Nov  1 23:12:44 2011
@@ -355,7 +355,7 @@ public class PageLoaderImpl implements P
         // Sanity check: since an extension point defines its own default, it's going to
be hard to
         // not find an override, somewhere, for it.
 
-        throw new TapestryException(PageloadMessages.couldNotFindOverride(extensionPointId),
+        throw new TapestryException(String.format("Could not find an override for extension
point '%s'.", extensionPointId),
                 extensionPointToken.getLocation(), null);
     }
 
@@ -374,7 +374,7 @@ public class PageLoaderImpl implements P
 
             if (parentModel == null)
             {
-                throw new RuntimeException(PageloadMessages.noParentForExtension(model));
+                throw new RuntimeException(String.format("Component %s uses an extension
template, but does not have a parent component.", model.getComponentClassName()));
             }
 
             ComponentTemplate parentTemplate = templateSource.getTemplate(parentModel, assembler.getSelector());
@@ -462,7 +462,7 @@ public class PageLoaderImpl implements P
                 break;
 
             default:
-                throw new IllegalStateException(PageloadMessages.tokenNotImplemented(context.peekType()));
+                throw new IllegalStateException(String.format("Not yet implemented: %s",
context.peekType().toString()));
         }
     }
 
@@ -697,7 +697,9 @@ public class PageLoaderImpl implements P
             if (InternalUtils.isNonBlank(modelType) && embeddedType != null)
             {
                 throw new TapestryException(
-                        PageloadMessages.redundantEmbeddedComponentTypes(embeddedId, embeddedType,
modelType), token, null);
+                        String.format("Embedded component '%s' provides a type attribute
in the template ('%s') " +
+                                "as well as in the component class ('%s'). You should not
provide a type attribute " +
+                                "in the template when defining an embedded component within
the component class.", embeddedId, embeddedType, modelType), token, null);
             }
 
             embeddedType = modelType;

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/TokenStreamImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/TokenStreamImpl.java?rev=1196382&r1=1196381&r2=1196382&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/TokenStreamImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/pageload/TokenStreamImpl.java
Tue Nov  1 23:12:44 2011
@@ -1,4 +1,4 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 2009, 2011 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.
@@ -45,7 +45,7 @@ class TokenStreamImpl implements TokenSt
     private void checkMore()
     {
         if (!more())
-            throw new IllegalStateException(PageloadMessages.noMoreTokens());
+            throw new IllegalStateException("No more template tokens.");
     }
 
     public <T extends TemplateToken> T next(Class<T> type)



Mime
View raw message