325N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325N/A * This code is free software; you can redistribute it and/or modify it 325N/A * under the terms of the GNU General Public License version 2 only, as 325N/A * published by the Free Software Foundation. Oracle designates this 325N/A * particular file as subject to the "Classpath" exception as provided 325N/A * by Oracle in the LICENSE file that accompanied this code. 325N/A * This code is distributed in the hope that it will be useful, but WITHOUT 325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325N/A * version 2 for more details (a copy is included in the LICENSE file that 325N/A * accompanied this code). 325N/A * You should have received a copy of the GNU General Public License version 325N/A * 2 along with this work; if not, write to the Free Software Foundation, 325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325N/A * or visit www.oracle.com if you need additional information or have any 325N/A * NGCCRuntime extended with various utility methods for 325N/A * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) 325N/A /** The schema currently being parsed. */ 325N/A /** The @finalDefault value of the current schema. */ 325N/A /** The @blockDefault value of the current schema. */ 325N/A * The @elementFormDefault value of the current schema. 325N/A * True if local elements are qualified by default. 325N/A * The @attributeFormDefault value of the current schema. 325N/A * True if local attributes are qualified by default. 325N/A * True if the current schema is in a chameleon mode. 325N/A * This changes the way QNames are interpreted. 325N/A * Life is very miserable with XML Schema, as you see. 325N/A * URI that identifies the schema document. 325N/A * Maybe null if the system ID is not available. 325N/A * Keep the local name of elements encountered so far. 325N/A * This information is passed to AnnotationParser as 325N/A * Points to the {@link SchemaDocumentImpl} that represents the 325N/A * schema document being parsed. 325N/A // set up the default namespace binding 325N/A // hide artificial "double definitions" on simple types 325N/A return true;
// ditto for anyType 325N/A /* registers a patcher that will run after all the parsing has finished. */ 325N/A * Resolves relative URI found in the document. 325N/A * passed to the entity resolver. 325N/A * value of the schemaLocation attribute. Can be null. 325N/A * non-null if {@link EntityResolver} returned an {@link InputSource}, 325N/A * or if the relativeUri parameter seems to be pointing to something. 325N/A // if the base URI is not available, the document system ID is 325N/A // better than nothing. 325N/A // just ignore, this is a second try, return the fallback if this breaks 325N/A /** Includes the specified schema. */ 325N/A /** Imports the specified schema. */ 325N/A // we can't locate this document. Let's just hope that 325N/A // we already have the schema components for this schema 325N/A // or we will receive them in the future. 325N/A * Called when a new document is being parsed and checks 325N/A * if the document has already been parsed before. 325N/A * Used to avoid recursive inclusion. Note that the same 325N/A * document will be parsed multiple times if they are for different 325N/A * <h2>Document Graph Model</h2> 325N/A * The challenge we are facing here is that you have a graph of 325N/A * documents that reference each other. Each document has an unique 325N/A * URI to identify themselves, and references are done by using those. 325N/A * The graph may contain cycles. 325N/A * Our goal here is to parse all the documents in the graph, without 325N/A * parsing the same document twice. This method implements this check. 325N/A * One complication is the chameleon schema; a document can be parsed 325N/A * multiple times if they are under different target namespaces. 325N/A * Also, note that when you resolve relative URIs in the @schemaLocation, 325N/A * their base URI is *NOT* the URI of the document. 325N/A * @return true if the document has already been processed and thus 325N/A // change file:///abc to file:/abc 325N/A // JDK File.toURL method produces the latter, but according to RFC 325N/A // I don't think that's a valid URL. Since two different ways of 325N/A // producing URLs could produce those two different forms, 325N/A // we need to canonicalize one to the other. 325N/A // if the system Id is not provided, we can't test the identity, 325N/A // so we have no choice but to read it. 325N/A // the newly created SchemaDocumentImpl will be unique one 325N/A * Parses the specified entity. 325N/A * @param importLocation 325N/A * Used for reporting errors. 325N/A * Creates a new instance of annotation parser. 325N/A * Gets the element name that contains the annotation element. 325N/A * This method works correctly only when called by the annotation handler. 325N/A /** Creates a copy of the current locator object. */ 325N/A// ValidationContext implementation 325N/A // this object lives longer than the parser itself, 325N/A // so it's important for this object not to have any reference 325N/A // XSDLib don't use those methods, so we cut a corner here. 325N/A /** Returns an immutable snapshot of the current context. */ 325N/A /** Parses UName under the given context. */ 325N/A // chamelon behavior. ugly... 325N/A // this is guaranteed to resolve 325N/A // prefix failed to resolve. 325N/A uri=
"undefined";
// replace with a dummy 325N/A "Unexpected {0} appears at line {1} column {2}",
325N/A throw e;
// we will abort anyway