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: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036:
037: package com.sun.xml.bind.v2.model.impl;
038:
039: import java.text.MessageFormat;
040: import java.util.ResourceBundle;
041:
042: /**
043: * Message resources
044: */
045: enum Messages {
046: // ClassInfoImpl
047: ID_MUST_BE_STRING, // 1 arg
048:
049: MUTUALLY_EXCLUSIVE_ANNOTATIONS, // 2 args
050: DUPLICATE_ANNOTATIONS, // 1 arg
051: NO_DEFAULT_CONSTRUCTOR, // 1 arg
052: CANT_HANDLE_INTERFACE, // 1 arg
053: CANT_HANDLE_INNER_CLASS, // 1 arg
054: ANNOTATION_ON_WRONG_METHOD, // 0 args
055: GETTER_SETTER_INCOMPATIBLE_TYPE, // 2 args
056: DUPLICATE_ENTRY_IN_PROP_ORDER, // 1 arg
057: DUPLICATE_PROPERTIES, // 1 arg
058:
059: XML_ELEMENT_MAPPING_ON_NON_IXMLELEMENT_METHOD, // 1 arg
060: SCOPE_IS_NOT_COMPLEXTYPE, // 1 arg
061: CONFLICTING_XML_ELEMENT_MAPPING, // 2 args
062:
063: REFERENCE_TO_NON_ELEMENT, // 1 arg
064:
065: NON_EXISTENT_ELEMENT_MAPPING, // 2 args
066:
067: TWO_ATTRIBUTE_WILDCARDS, // 1 arg
068: SUPER_CLASS_HAS_WILDCARD, // 0 args
069: INVALID_ATTRIBUTE_WILDCARD_TYPE, // 1 arg
070: PROPERTY_MISSING_FROM_ORDER, // 1 arg
071: PROPERTY_ORDER_CONTAINS_UNUSED_ENTRY, // 2 args
072:
073: INVALID_XML_ENUM_VALUE, // 2 arg
074: FAILED_TO_INITIALE_DATATYPE_FACTORY, // 0 args
075: NO_IMAGE_WRITER, // 1 arg
076:
077: ILLEGAL_MIME_TYPE, // 2 args
078: ILLEGAL_ANNOTATION, // 1 arg
079:
080: MULTIPLE_VALUE_PROPERTY, // 0 args
081: ELEMENT_AND_VALUE_PROPERTY, // 0 args
082: CONFLICTING_XML_TYPE_MAPPING, // 1 arg
083: XMLVALUE_IN_DERIVED_TYPE, // 0 args
084: SIMPLE_TYPE_IS_REQUIRED, // 1 arg
085: PROPERTY_COLLISION, // 1 arg
086: INVALID_IDREF, // 1 arg
087: INVALID_XML_ELEMENT_REF, // 0 arg
088: NO_XML_ELEMENT_DECL, // 2 args
089: XML_ELEMENT_WRAPPER_ON_NON_COLLECTION, // 1 arg
090:
091: ANNOTATION_NOT_ALLOWED, // 1 arg
092: XMLLIST_NEEDS_SIMPLETYPE, // 1 arg
093: XMLLIST_ON_SINGLE_PROPERTY, // 0 arg
094: NO_FACTORY_METHOD, // 2 args
095: FACTORY_CLASS_NEEDS_FACTORY_METHOD, // 1 arg
096:
097: INCOMPATIBLE_API_VERSION, // 2 args
098: INCOMPATIBLE_API_VERSION_MUSTANG, // 2 args
099: RUNNING_WITH_1_0_RUNTIME, // 2 args
100:
101: MISSING_JAXB_PROPERTIES, // 1arg
102: TRANSIENT_FIELD_NOT_BINDABLE, // 1 arg
103: THERE_MUST_BE_VALUE_IN_XMLVALUE, // 1 arg
104: UNMATCHABLE_ADAPTER, // 2 args
105: ANONYMOUS_ARRAY_ITEM, // 1 arg
106:
107: ACCESSORFACTORY_INSTANTIATION_EXCEPTION, // 2 arg
108: ACCESSORFACTORY_ACCESS_EXCEPTION, // 2 arg
109: CUSTOM_ACCESSORFACTORY_PROPERTY_ERROR, // 2 arg
110: CUSTOM_ACCESSORFACTORY_FIELD_ERROR, // 2 arg
111: XMLGREGORIANCALENDAR_INVALID, // 1 arg
112: XMLGREGORIANCALENDAR_SEC, // 0 arg
113: XMLGREGORIANCALENDAR_MIN, // 0 arg
114: XMLGREGORIANCALENDAR_HR, // 0 arg
115: XMLGREGORIANCALENDAR_DAY, // 0 arg
116: XMLGREGORIANCALENDAR_MONTH, // 0 arg
117: XMLGREGORIANCALENDAR_YEAR, // 0 arg
118: XMLGREGORIANCALENDAR_TIMEZONE, // 0 arg
119: ;
120:
121: private static final ResourceBundle rb = ResourceBundle
122: .getBundle(Messages.class.getName());
123:
124: public String toString() {
125: return format();
126: }
127:
128: public String format(Object... args) {
129: return MessageFormat.format(rb.getString(name()), args);
130: }
131: }
|