001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * Portions Copyright Apache Software Foundation.
007: *
008: * The contents of this file are subject to the terms of either the GNU
009: * General Public License Version 2 only ("GPL") or the Common Development
010: * and Distribution License("CDDL") (collectively, the "License"). You
011: * may not use this file except in compliance with the License. You can obtain
012: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
013: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
014: * language governing permissions and limitations under the License.
015: *
016: * When distributing the software, include this License Header Notice in each
017: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
018: * Sun designates this particular file as subject to the "Classpath" exception
019: * as provided by Sun in the GPL Version 2 section of the License file that
020: * accompanied this code. If applicable, add the following below the License
021: * Header, with the fields enclosed by brackets [] replaced by your own
022: * identifying information: "Portions Copyrighted [year]
023: * [name of copyright owner]"
024: *
025: * Contributor(s):
026: *
027: * If you wish your version of this file to be governed by only the CDDL or
028: * only the GPL Version 2, indicate your decision by adding "[Contributor]
029: * elects to include this software in this distribution under the [CDDL or GPL
030: * Version 2] license." If you don't indicate a single choice of license, a
031: * recipient has the option to distribute your version of this file under
032: * either the CDDL, the GPL Version 2 or to extend the choice of license to
033: * its licensees as provided above. However, if you add GPL Version 2 code
034: * and therefore, elected the GPL Version 2 license, then the option applies
035: * only if the new code is made subject to such option by the copyright
036: * holder.
037: */
038:
039: package org.apache.taglibs.standard.lang.jstl;
040:
041: import java.util.MissingResourceException;
042: import java.util.ResourceBundle;
043:
044: /**
045: *
046: * <p>This contains all of the non-public constants, including
047: * messsage strings read from the resource file.
048: *
049: * @author Nathan Abramson - Art Technology Group
050: * @author Shawn Bayern
051: *
052: * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: tcfujii $
053: **/
054:
055: public class Constants {
056: //-------------------------------------
057: // Resources
058:
059: static ResourceBundle sResources = ResourceBundle
060: .getBundle("org.apache.taglibs.standard.lang.jstl.Resources");
061:
062: //-------------------------------------
063: // Messages from the resource bundle
064: //-------------------------------------
065:
066: public static final String EXCEPTION_GETTING_BEANINFO = getStringResource("EXCEPTION_GETTING_BEANINFO");
067:
068: public static final String NULL_EXPRESSION_STRING = getStringResource("NULL_EXPRESSION_STRING");
069:
070: public static final String PARSE_EXCEPTION = getStringResource("PARSE_EXCEPTION");
071:
072: public static final String CANT_GET_PROPERTY_OF_NULL = getStringResource("CANT_GET_PROPERTY_OF_NULL");
073:
074: public static final String NO_SUCH_PROPERTY = getStringResource("NO_SUCH_PROPERTY");
075:
076: public static final String NO_GETTER_METHOD = getStringResource("NO_GETTER_METHOD");
077:
078: public static final String ERROR_GETTING_PROPERTY = getStringResource("ERROR_GETTING_PROPERTY");
079:
080: public static final String CANT_GET_INDEXED_VALUE_OF_NULL = getStringResource("CANT_GET_INDEXED_VALUE_OF_NULL");
081:
082: public static final String CANT_GET_NULL_INDEX = getStringResource("CANT_GET_NULL_INDEX");
083:
084: public static final String NULL_INDEX = getStringResource("NULL_INDEX");
085:
086: public static final String BAD_INDEX_VALUE = getStringResource("BAD_INDEX_VALUE");
087:
088: public static final String EXCEPTION_ACCESSING_LIST = getStringResource("EXCEPTION_ACCESSING_LIST");
089:
090: public static final String EXCEPTION_ACCESSING_ARRAY = getStringResource("EXCEPTION_ACCESSING_ARRAY");
091:
092: public static final String CANT_FIND_INDEX = getStringResource("CANT_FIND_INDEX");
093:
094: public static final String TOSTRING_EXCEPTION = getStringResource("TOSTRING_EXCEPTION");
095:
096: public static final String BOOLEAN_TO_NUMBER = getStringResource("BOOLEAN_TO_NUMBER");
097:
098: public static final String STRING_TO_NUMBER_EXCEPTION = getStringResource("STRING_TO_NUMBER_EXCEPTION");
099:
100: public static final String COERCE_TO_NUMBER = getStringResource("COERCE_TO_NUMBER");
101:
102: public static final String BOOLEAN_TO_CHARACTER = getStringResource("BOOLEAN_TO_CHARACTER");
103:
104: public static final String EMPTY_STRING_TO_CHARACTER = getStringResource("EMPTY_STRING_TO_CHARACTER");
105:
106: public static final String COERCE_TO_CHARACTER = getStringResource("COERCE_TO_CHARACTER");
107:
108: public static final String NULL_TO_BOOLEAN = getStringResource("NULL_TO_BOOLEAN");
109:
110: public static final String STRING_TO_BOOLEAN = getStringResource("STRING_TO_BOOLEAN");
111:
112: public static final String COERCE_TO_BOOLEAN = getStringResource("COERCE_TO_BOOLEAN");
113:
114: public static final String COERCE_TO_OBJECT = getStringResource("COERCE_TO_OBJECT");
115:
116: public static final String NO_PROPERTY_EDITOR = getStringResource("NO_PROPERTY_EDITOR");
117:
118: public static final String PROPERTY_EDITOR_ERROR = getStringResource("PROPERTY_EDITOR_ERROR");
119:
120: public static final String ARITH_OP_NULL = getStringResource("ARITH_OP_NULL");
121:
122: public static final String ARITH_OP_BAD_TYPE = getStringResource("ARITH_OP_BAD_TYPE");
123:
124: public static final String ARITH_ERROR = getStringResource("ARITH_ERROR");
125:
126: public static final String ERROR_IN_EQUALS = getStringResource("ERROR_IN_EQUALS");
127:
128: public static final String UNARY_OP_BAD_TYPE = getStringResource("UNARY_OP_BAD_TYPE");
129:
130: public static final String NAMED_VALUE_NOT_FOUND = getStringResource("NAMED_VALUE_NOT_FOUND");
131:
132: public static final String CANT_GET_INDEXED_PROPERTY = getStringResource("CANT_GET_INDEXED_PROPERTY");
133:
134: public static final String COMPARABLE_ERROR = getStringResource("COMPARABLE_ERROR");
135:
136: public static final String BAD_IMPLICIT_OBJECT = getStringResource("BAD_IMPLICIT_OBJECT");
137:
138: public static final String ATTRIBUTE_EVALUATION_EXCEPTION = getStringResource("ATTRIBUTE_EVALUATION_EXCEPTION");
139:
140: public static final String ATTRIBUTE_PARSE_EXCEPTION = getStringResource("ATTRIBUTE_PARSE_EXCEPTION");
141:
142: public static final String UNKNOWN_FUNCTION = getStringResource("UNKNOWN_FUNCTION");
143:
144: public static final String INAPPROPRIATE_FUNCTION_ARG_COUNT = getStringResource("INAPPROPRIATE_FUNCTION_ARG_COUNT");
145:
146: public static final String FUNCTION_INVOCATION_ERROR = getStringResource("FUNCTION_INVOCATION_ERROR");
147:
148: //-------------------------------------
149: // Getting resources
150: //-------------------------------------
151: /**
152: *
153: *
154: **/
155: public static String getStringResource(String pResourceName)
156: throws MissingResourceException {
157: try {
158: String ret = sResources.getString(pResourceName);
159: if (ret == null) {
160: String str = "ERROR: Unable to load resource "
161: + pResourceName;
162: System.err.println(str);
163: throw new MissingResourceException(
164: str,
165: "org.apache.taglibs.standard.lang.jstl.Constants",
166: pResourceName);
167: } else {
168: return ret;
169: }
170: } catch (MissingResourceException exc) {
171: System.err.println("ERROR: Unable to load resource "
172: + pResourceName + ": " + exc);
173: throw exc;
174: }
175: }
176:
177: //-------------------------------------
178: }
|