01: /*
02: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25:
26: package com.sun.tools.internal.xjc.api;
27:
28: import java.io.IOException;
29:
30: import javax.xml.bind.SchemaOutputResolver;
31: import javax.xml.namespace.QName;
32:
33: /**
34: * {@link JAXBModel} that exposes additional information available
35: * only for the java->schema direction.
36: *
37: * @author Kohsuke Kawaguchi
38: */
39: public interface J2SJAXBModel extends JAXBModel {
40: /**
41: * Returns the name of the XML Type bound to the
42: * specified Java type.
43: *
44: * @param javaType
45: * must not be null. This must be one of the {@link Reference}s specified
46: * in the {@link JavaCompiler#bind} method.
47: *
48: * @return
49: * null if it is not a part of the input to {@link JavaCompiler#bind}.
50: *
51: * @throws IllegalArgumentException
52: * if the parameter is null
53: */
54: QName getXmlTypeName(Reference javaType);
55:
56: /**
57: * Generates the schema documents from the model.
58: *
59: * <p>
60: * The caller can use the additionalElementDecls parameter to
61: * add element declarations to the generate schema.
62: * For example, if the JAX-RPC passes in the following entry:
63: *
64: * {foo}bar -> DeclaredType for java.lang.String
65: *
66: * then JAXB generates the following element declaration (in the schema
67: * document for the namespace "foo")"
68: *
69: * <xs:element name="bar" type="xs:string" />
70: *
71: * This can be used for generating schema components necessary for WSDL.
72: *
73: * @param outputResolver
74: * this object controls the output to which schemas
75: * will be sent.
76: *
77: * @throws IOException
78: * if {@link SchemaOutputResolver} throws an {@link IOException}.
79: */
80: void generateSchema(SchemaOutputResolver outputResolver,
81: ErrorListener errorListener) throws IOException;
82: }
|