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