KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > pageload > PageloadMessages


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.pageload;
16
17 import org.apache.hivemind.HiveMind;
18 import org.apache.hivemind.Location;
19 import org.apache.hivemind.impl.MessageFormatter;
20 import org.apache.tapestry.IBinding;
21 import org.apache.tapestry.IComponent;
22 import org.apache.tapestry.spec.IContainedComponent;
23
24 /**
25  * Messages for the pageload package
26  *
27  * @author Howard Lewis Ship
28  * @since 4.0
29  */

30 class PageloadMessages
31 {
32     protected static MessageFormatter _formatter = new MessageFormatter(PageloadMessages.class,
33             "PageloadStrings");
34
35     static String JavaDoc parameterMustHaveNoDefaultValue(IComponent component, String JavaDoc name)
36     {
37         return _formatter.format(
38                 "parameter-must-have-no-default-value",
39                 component.getExtendedId(),
40                 name);
41     }
42
43     static String JavaDoc unableToInitializeProperty(String JavaDoc propertyName, IComponent component,
44             Throwable JavaDoc cause)
45     {
46         return _formatter.format("unable-to-initialize-property", propertyName, component, cause);
47     }
48
49     static String JavaDoc requiredParameterNotBound(String JavaDoc name, IComponent component)
50     {
51         return _formatter.format("required-parameter-not-bound", name, component.getExtendedId());
52     }
53
54     static String JavaDoc inheritInformalInvalidComponentFormalOnly(IComponent component)
55     {
56         return _formatter.format("inherit-informal-invalid-component-formal-only", component
57                 .getExtendedId());
58     }
59
60     static String JavaDoc inheritInformalInvalidContainerFormalOnly(IComponent container,
61             IComponent component)
62     {
63         return _formatter.format("inherit-informal-invalid-container-formal-only", container
64                 .getExtendedId(), component.getExtendedId());
65     }
66
67     static String JavaDoc formalParametersOnly(IComponent component, String JavaDoc parameterName)
68     {
69         return _formatter
70                 .format("formal-parameters-only", component.getExtendedId(), parameterName);
71     }
72
73     static String JavaDoc unableToInstantiateComponent(IComponent container, Throwable JavaDoc cause)
74     {
75         return _formatter.format(
76                 "unable-to-instantiate-component",
77                 container.getExtendedId(),
78                 cause);
79     }
80
81     static String JavaDoc classNotComponent(Class JavaDoc componentClass)
82     {
83         return _formatter.format("class-not-component", componentClass.getName());
84     }
85
86     static String JavaDoc unableToInstantiate(String JavaDoc className, Throwable JavaDoc cause)
87     {
88         return _formatter.format("unable-to-instantiate", className, cause);
89     }
90
91     static String JavaDoc pageNotAllowed(String JavaDoc componentId)
92     {
93         return _formatter.format("page-not-allowed", componentId);
94     }
95
96     static String JavaDoc classNotPage(Class JavaDoc componentClass)
97     {
98         return _formatter.format("class-not-page", componentClass.getName());
99     }
100
101     static String JavaDoc defaultParameterName(String JavaDoc name)
102     {
103         return _formatter.format("default-parameter-name", name);
104     }
105
106     static String JavaDoc initializerName(String JavaDoc propertyName)
107     {
108         return _formatter.format("initializer-name", propertyName);
109     }
110
111     static String JavaDoc parameterName(String JavaDoc name)
112     {
113         return _formatter.format("parameter-name", name);
114     }
115
116     static String JavaDoc duplicateParameter(String JavaDoc parameterName, IBinding binding)
117     {
118         return _formatter.format("duplicate-parameter", parameterName, HiveMind
119                 .getLocationString(binding));
120     }
121
122     public static String JavaDoc usedParameterAlias(IContainedComponent contained, String JavaDoc name,
123             String JavaDoc parameterName, Location bindingLocation)
124     {
125         return _formatter.format("used-parameter-alias", new Object JavaDoc[]
126         { HiveMind.getLocationString(bindingLocation), contained.getType(), name, parameterName });
127     }
128
129     public static String JavaDoc deprecatedParameter(String JavaDoc parameterName, Location location,
130             String JavaDoc componentType)
131     {
132         return _formatter.format("deprecated-parameter", parameterName, HiveMind
133                 .getLocationString(location), componentType);
134     }
135
136 }
Popular Tags