Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxws/src/share/jaxws_classes/javax/xml/bind/SchemaOutputResolver.java
38890 views
/*1* Copyright (c) 2005, 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 javax.xml.transform.Result;28import java.io.IOException;2930/**31* Controls where a JAXB implementation puts the generates32* schema files.33*34* <p>35* An implementation of this abstract class has to be provided by the calling36* application to generate schemas.37*38* <p>39* This is a class, not an interface so as to allow future versions to evolve40* without breaking the compatibility.41*42* @author43* Kohsuke Kawaguchi ([email protected])44*/45public abstract class SchemaOutputResolver {46/**47* Decides where the schema file (of the given namespace URI)48* will be written, and return it as a {@link Result} object.49*50* <p>51* This method is called only once for any given namespace.52* IOW, all the components in one namespace is always written53* into the same schema document.54*55* @param namespaceUri56* The namespace URI that the schema declares.57* Can be the empty string, but never be null.58* @param suggestedFileName59* A JAXB implementation generates an unique file name (like "schema1.xsd")60* for the convenience of the callee. This name can be61* used for the file name of the schema, or the callee can just62* ignore this name and come up with its own name.63* This is just a hint.64*65* @return66* a {@link Result} object that encapsulates the actual destination67* of the schema.68*69* If the {@link Result} object has a system ID, it must be an70* absolute system ID. Those system IDs are relativized by the caller and used71* for <xs:import> statements.72*73* If the {@link Result} object does not have a system ID, a schema74* for the namespace URI is generated but it won't be explicitly75* <xs:import>ed from other schemas.76*77* If {@code null} is returned, the schema generation for this78* namespace URI will be skipped.79*/80public abstract Result createOutput( String namespaceUri, String suggestedFileName ) throws IOException;81}828384