1/* 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26package com.sun.tools.internal.xjc.reader.internalizer; 27 28import java.text.MessageFormat; 29import java.util.ResourceBundle; 30 31/** 32 * Formats error messages. 33 */ 34class Messages 35{ 36 /** Loads a string resource and formats it with specified arguments. */ 37 static String format( String property, Object... args ) { 38 String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle").getString(property); 39 return MessageFormat.format(text,args); 40 } 41 42 static final String ERR_INCORRECT_SCHEMA_REFERENCE = // args:2 43 "Internalizer.IncorrectSchemaReference"; 44 static final String ERR_XPATH_EVAL = // arg:1 45 "Internalizer.XPathEvaluationError"; 46 static final String NO_XPATH_EVAL_TO_NO_TARGET = // arg:1 47 "Internalizer.XPathEvaluatesToNoTarget"; 48 static final String NO_XPATH_EVAL_TOO_MANY_TARGETS = // arg:2 49 "Internalizer.XPathEvaulatesToTooManyTargets"; 50 static final String NO_XPATH_EVAL_TO_NON_ELEMENT = // arg:1 51 "Internalizer.XPathEvaluatesToNonElement"; 52 static final String XPATH_EVAL_TO_NON_SCHEMA_ELEMENT = // arg:2 53 "Internalizer.XPathEvaluatesToNonSchemaElement"; 54 static final String SCD_NOT_ENABLED = // arg:0 55 "SCD_NOT_ENABLED"; 56 static final String ERR_SCD_EVAL = // arg: 1 57 "ERR_SCD_EVAL"; 58 static final String ERR_SCD_EVALUATED_EMPTY = // arg:1 59 "ERR_SCD_EVALUATED_EMPTY"; 60 static final String ERR_SCD_MATCHED_MULTIPLE_NODES = // arg:2 61 "ERR_SCD_MATCHED_MULTIPLE_NODES"; 62 static final String ERR_SCD_MATCHED_MULTIPLE_NODES_FIRST = // arg:1 63 "ERR_SCD_MATCHED_MULTIPLE_NODES_FIRST"; 64 static final String ERR_SCD_MATCHED_MULTIPLE_NODES_SECOND = // arg:1 65 "ERR_SCD_MATCHED_MULTIPLE_NODES_SECOND"; 66 static final String CONTEXT_NODE_IS_NOT_ELEMENT = // arg:0 67 "Internalizer.ContextNodeIsNotElement"; 68 static final String ERR_INCORRECT_VERSION = // arg:0 69 "Internalizer.IncorrectVersion"; 70 static final String ERR_VERSION_NOT_FOUND = // arg:0 71 "Internalizer.VersionNotPresent"; 72 static final String TWO_VERSION_ATTRIBUTES = // arg:0 73 "Internalizer.TwoVersionAttributes"; 74 static final String ORPHANED_CUSTOMIZATION = // arg:1 75 "Internalizer.OrphanedCustomization"; 76 static final String ERR_UNABLE_TO_PARSE = // arg:2 77 "AbstractReferenceFinderImpl.UnableToParse"; 78 static final String ERR_FILENAME_IS_NOT_URI = // arg:0 79 "ERR_FILENAME_IS_NOT_URI"; 80 static final String ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR = // arg:1 81 "ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR"; 82 static final String DOMFOREST_INPUTSOURCE_IOEXCEPTION = // arg:2 83 "DOMFOREST_INPUTSOURCE_IOEXCEPTION"; 84 85} 86