KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > schema > rules > RulesMessages


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.hivemind.schema.rules;
16
17 import org.apache.hivemind.Element;
18 import org.apache.hivemind.HiveMind;
19 import org.apache.hivemind.Location;
20 import org.apache.hivemind.impl.MessageFormatter;
21 import org.apache.hivemind.internal.Module;
22 import org.apache.hivemind.schema.SchemaProcessor;
23
24 /**
25  * Messages related to the rules package.
26  *
27  * @author Howard Lewis Ship
28  */

29 public class RulesMessages
30 {
31
32     protected static MessageFormatter _formatter = new MessageFormatter(RulesMessages.class);
33
34     public static String JavaDoc unableToSetElementProperty(String JavaDoc propertyName, Object JavaDoc target,
35             SchemaProcessor processor, Element element, Throwable JavaDoc cause)
36     {
37         return _formatter.format("unable-to-set-element-property", new Object JavaDoc[]
38         { propertyName, target, processor.getElementPath(), HiveMind.getLocationString(element),
39                 cause });
40     }
41
42     public static String JavaDoc unableToSetProperty(String JavaDoc propertyName, Object JavaDoc target, Throwable JavaDoc cause)
43     {
44         return _formatter.format("unable-to-set-property", propertyName, target, cause);
45     }
46
47     public static String JavaDoc invalidBooleanValue(String JavaDoc inputValue)
48     {
49         return _formatter.format("invalid-boolean-value", inputValue);
50     }
51
52     public static String JavaDoc invalidDoubleValue(String JavaDoc inputValue)
53     {
54         return _formatter.format("invalid-double-value", inputValue);
55     }
56
57     public static String JavaDoc minDoubleValue(String JavaDoc inputValue, double minValue)
58     {
59         return _formatter.format("min-double-value", inputValue, new Double JavaDoc(minValue));
60     }
61
62     public static String JavaDoc maxDoubleValue(String JavaDoc inputValue, double maxValue)
63     {
64         return _formatter.format("max-double-value", inputValue, new Double JavaDoc(maxValue));
65     }
66
67     public static String JavaDoc enumNotRecognized(String JavaDoc inputValue)
68     {
69         return _formatter.format("enum-not-recognized", inputValue);
70     }
71
72     public static String JavaDoc enumError(Class JavaDoc enumClass, String JavaDoc fieldName, Throwable JavaDoc cause)
73     {
74         return _formatter.format("enum-error", enumClass.getName(), fieldName, cause);
75     }
76
77     public static String JavaDoc invalidIntValue(String JavaDoc inputValue)
78     {
79         return _formatter.format("invalid-int-value", inputValue);
80     }
81
82     public static String JavaDoc minIntValue(String JavaDoc inputValue, int minValue)
83     {
84         return _formatter.format("min-int-value", inputValue, new Integer JavaDoc(minValue));
85     }
86
87     public static String JavaDoc maxIntValue(String JavaDoc inputValue, int maxValue)
88     {
89         return _formatter.format("max-int-value", inputValue, new Integer JavaDoc(maxValue));
90     }
91
92     public static String JavaDoc errorInvokingMethod(String JavaDoc methodName, Object JavaDoc parent, Location location,
93             Throwable JavaDoc cause)
94     {
95         return _formatter.format("error-invoking-method", new Object JavaDoc[]
96         { methodName, parent.getClass().getName(), location, cause });
97     }
98
99     public static String JavaDoc invalidLongValue(String JavaDoc inputValue)
100     {
101         return _formatter.format("invalid-long-value", inputValue);
102     }
103
104     public static String JavaDoc minLongValue(String JavaDoc inputValue, long minValue)
105     {
106         return _formatter.format("min-long-value", inputValue, new Long JavaDoc(minValue));
107     }
108
109     public static String JavaDoc maxLongValue(String JavaDoc inputValue, long maxValue)
110     {
111         return _formatter.format("max-long-value", inputValue, new Long JavaDoc(maxValue));
112     }
113
114     public static String JavaDoc readAttributeFailure(String JavaDoc attributeName, Element element,
115             SchemaProcessor processor, Throwable JavaDoc cause)
116     {
117         return _formatter.format("read-attribute-failure", new Object JavaDoc[]
118         { attributeName, processor.getElementPath(), cause });
119     }
120
121     public static String JavaDoc readContentFailure(SchemaProcessor processor, Element element, Throwable JavaDoc cause)
122     {
123         return _formatter.format("read-content-failure", processor.getElementPath(), cause);
124     }
125
126     public static String JavaDoc resourceLocalizationError(String JavaDoc inputValue, Module contributingModule)
127     {
128         return _formatter.format("resource-localization-error", inputValue, contributingModule
129                 .getModuleId());
130     }
131
132     public static String JavaDoc invalidInitializer(String JavaDoc initializer)
133     {
134         return _formatter.format("invalid-initializer", initializer);
135     }
136
137     public static String JavaDoc noPropertyEditor(Class JavaDoc propertyType)
138     {
139         return _formatter.format("no-property-editor", propertyType.getName());
140     }
141
142     public static String JavaDoc smartTranslatorError(String JavaDoc inputValue, Class JavaDoc propertyType, Throwable JavaDoc cause)
143     {
144         return _formatter.format(
145                 "smart-translator-error",
146                 inputValue,
147                 propertyType.getName(),
148                 cause);
149     }
150 }
Popular Tags