Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxws/src/share/jaxws_classes/javax/xml/bind/Messages.java
38890 views
/*1* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.bind;2627import java.text.MessageFormat;28import java.util.ResourceBundle;2930/**31* Formats error messages.32*/33class Messages34{35static String format( String property ) {36return format( property, null );37}3839static String format( String property, Object arg1 ) {40return format( property, new Object[]{arg1} );41}4243static String format( String property, Object arg1, Object arg2 ) {44return format( property, new Object[]{arg1,arg2} );45}4647static String format( String property, Object arg1, Object arg2, Object arg3 ) {48return format( property, new Object[]{arg1,arg2,arg3} );49}5051// add more if necessary.5253/** Loads a string resource and formats it with specified arguments. */54static String format( String property, Object[] args ) {55String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);56return MessageFormat.format(text,args);57}5859//60//61// Message resources62//63//64static final String PROVIDER_NOT_FOUND = // 1 arg65"ContextFinder.ProviderNotFound";6667static final String COULD_NOT_INSTANTIATE = // 2 args68"ContextFinder.CouldNotInstantiate";6970static final String CANT_FIND_PROPERTIES_FILE = // 1 arg71"ContextFinder.CantFindPropertiesFile";7273static final String CANT_MIX_PROVIDERS = // 0 args74"ContextFinder.CantMixProviders";7576static final String MISSING_PROPERTY = // 2 args77"ContextFinder.MissingProperty";7879static final String NO_PACKAGE_IN_CONTEXTPATH = // 0 args80"ContextFinder.NoPackageInContextPath";8182static final String NAME_VALUE = // 2 args83"PropertyException.NameValue";8485static final String CONVERTER_MUST_NOT_BE_NULL = // 0 args86"DatatypeConverter.ConverterMustNotBeNull";8788static final String ILLEGAL_CAST = // 2 args89"JAXBContext.IllegalCast";90}919293