|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.bind Class SchemaOutputResolver
java.lang.Object javax.xml.bind.SchemaOutputResolver
public abstract class SchemaOutputResolver
- extends Object
控制 JAXB 实现放置生成的模式文件的位置。
此抽象类的实现必须由生成模式的调用应用程序提供。
这是一个类,不是接口,这使得以后的版本可在不破坏兼容性的情况下进行改进。
Controls where a JAXB implementation puts the generates schema files.
An implementation of this abstract class has to be provided by the calling application to generate schemas.
This is a class, not an interface so as to allow future versions to evolve without breaking the compatibility.
- Author:
- Kohsuke Kawaguchi ([email protected])
Constructor Summary | |
---|---|
SchemaOutputResolver()
|
Method Summary | |
---|---|
abstract Result |
createOutput(String namespaceUri,
String suggestedFileName)
Decides where the schema file (of the given namespace URI) will be written, and return it as a Result object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public
SchemaOutputResolver()
英文文档:
SchemaOutputResolver
public SchemaOutputResolver()
Method Detail |
---|
abstract public javax.xml.transform.Result
createOutput(String namespaceUri, String suggestedFileName) throws java.io.IOException
确定写入模式文件(由给定名称空间 URI 指定)的位置,并以 Result
对象的形式返回它。
对于任何给定名称空间,此方法只调用一次。换句话说,一个名称空间中的所有组件总是写入相同的模式文档。
namespaceUri | 模式声明的名称空间 URI。可以为空字符串,但永远不能为 null。 |
suggestedFileName | JAXB 实现生成一个唯一文件名(如 "schema1.xsd"),以方便调用者使用。此名称可用于模式的文件名,或者调用者可以忽略此名称并提供自己的名称。这只是一个提示。 |
return |
封装实际的模式目的地的 Result 对象。
如果 Result 对象有系统 ID,则该 ID 必须是绝对系统 ID。这些系统 ID 是相对于调用者的,并且可用于 <xs:import> 语句。
如果 Result 对象没有系统 ID,则生成一个用于名称空间 URI 的模式,但它不能从其他模式显式地 <xs:import>。
如果返回 null ,则跳过此名称空间 URI 的模式生成。 |
createOutput
public abstract Result createOutput(String namespaceUri, String suggestedFileName) throws IOException
- Decides where the schema file (of the given namespace URI)
will be written, and return it as a
Result
object.This method is called only once for any given namespace. IOW, all the components in one namespace is always written into the same schema document.
- Parameters:
namespaceUri
- The namespace URI that the schema declares. Can be the empty string, but never be null.suggestedFileName
- A JAXB implementation generates an unique file name (like "schema1.xsd") for the convenience of the callee. This name can be used for the file name of the schema, or the callee can just ignore this name and come up with its own name. This is just a hint.- Returns:
- a
Result
object that encapsulates the actual destination of the schema. If theResult
object has a system ID, it must be an absolute system ID. Those system IDs are relativized by the caller and used for <xs:import> statements. If theResult
object does not have a system ID, a schema for the namespace URI is generated but it won't be explicitly <xs:import>ed from other schemas. Ifnull
is returned, the schema generation for this namespace URI will be skipped. - Throws:
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!