blob: efc6b0d208af9cc7b8e1a226de8edfcb2607711a [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>XmlSchema</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="XmlSchema";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../jakarta/xml/bind/annotation/XmlRootElement.html" title="annotation in jakarta.xml.bind.annotation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../jakarta/xml/bind/annotation/XmlSchemaType.html" title="annotation in jakarta.xml.bind.annotation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?jakarta/xml/bind/annotation/XmlSchema.html" target="_top">Frames</a></li>
<li><a href="XmlSchema.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#annotation.type.field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Required&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#annotation.type.field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">jakarta.xml.bind.annotation</div>
<h2 title="Annotation Type XmlSchema" class="title">Annotation Type XmlSchema</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>@Retention(value=RUNTIME)
@Target(value=PACKAGE)
public @interface <span class="memberNameLabel">XmlSchema</span></pre>
<div class="block"><p> Maps a package name to a XML namespace. </p>
<h2>Usage</h2>
<p>
The XmlSchema annotation can be used with the following program
elements:
<ul>
<li>package</li>
</ul>
<p>
This is a package level annotation and follows the recommendations
and restrictions contained in JSR 175, section III, "Annotations".
Thus the usage is subject to the following constraints and
recommendations.
<ul>
<li> There can only be one package declaration as noted in JSR
175, section III, "Annotations". </li>
<li> JSR 175 recommends package-info.java for package level
annotations. JAXB Providers that follow this recommendation
will allow the package level annotations to be defined in
package-info.java.
</ul>
<p><b>Example 1:</b> Customize name of XML namespace to which
package is mapped.</p>
<pre>
&#64;jakarta.xml.bind.annotation.XmlSchema (
namespace = "http://www.example.com/MYPO1"
)
<code>
&lt;!-- XML Schema fragment --&gt;
&lt;schema
xmlns=...
xmlns:po=....
targetNamespace="http://www.example.com/MYPO1"
&gt;
&lt;!-- prefixes generated by default are implementation
depedenent --&gt;
</code></pre>
<p><b>Example 2:</b> Customize namespace prefix, namespace URI
mapping</p>
<pre>
// Package level annotation
&#64;jakarta.xml.bind.annotation.XmlSchema (
xmlns = {
&#64;jakarta.xml.bind.annotation.XmlNs(prefix = "po",
namespaceURI="http://www.example.com/myPO1"),
&#64;jakarta.xml.bind.annotation.XmlNs(prefix="xs",
namespaceURI="http://www.w3.org/2001/XMLSchema")
}
)
<code>
&lt;!-- XML Schema fragment --&gt;
&lt;schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:po="http://www.example.com/PO1"
targetNamespace="http://www.example.com/PO1"&gt;
</code></pre>
<p><b>Example 3:</b> Customize elementFormDefault</p>
<pre>
&#64;jakarta.xml.bind.annotation.XmlSchema (
elementFormDefault=XmlNsForm.UNQUALIFIED
...
)
<code>
&lt;!-- XML Schema fragment --&gt;
&lt;schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:po="http://www.example.com/PO1"
elementFormDefault="unqualified"&gt;
</code></pre></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.6, JAXB 2.0</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Fields and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#NO_LOCATION">NO_LOCATION</a></span></code>
<div class="block">The default value of the <a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#location--"><code>location()</code></a> attribute,
which indicates that the schema generator will generate
components in this namespace.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.optional.element.summary">
<!-- -->
</a>
<h3>Optional Element Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Optional Element and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../jakarta/xml/bind/annotation/XmlNsForm.html" title="enum in jakarta.xml.bind.annotation">XmlNsForm</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#attributeFormDefault--">attributeFormDefault</a></span></code>
<div class="block">Namespace qualification for attributes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../jakarta/xml/bind/annotation/XmlNsForm.html" title="enum in jakarta.xml.bind.annotation">XmlNsForm</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#elementFormDefault--">elementFormDefault</a></span></code>
<div class="block">Namespace qualification for elements.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#location--">location</a></span></code>
<div class="block">Indicates that this namespace (specified by <a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#namespace--"><code>namespace()</code></a>)
has a schema already available exeternally, available at this location.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#namespace--">namespace</a></span></code>
<div class="block">Name of the XML namespace.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../jakarta/xml/bind/annotation/XmlNs.html" title="annotation in jakarta.xml.bind.annotation">XmlNs</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#xmlns--">xmlns</a></span></code>
<div class="block">Customize the namespace URI, prefix associations.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="NO_LOCATION">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NO_LOCATION</h4>
<pre>public static final&nbsp;java.lang.String&nbsp;NO_LOCATION</pre>
<div class="block">The default value of the <a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#location--"><code>location()</code></a> attribute,
which indicates that the schema generator will generate
components in this namespace.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.element.detail">
<!-- -->
</a>
<h3>Element Detail</h3>
<a name="xmlns--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>xmlns</h4>
<pre>public abstract&nbsp;<a href="../../../../jakarta/xml/bind/annotation/XmlNs.html" title="annotation in jakarta.xml.bind.annotation">XmlNs</a>[]&nbsp;xmlns</pre>
<div class="block">Customize the namespace URI, prefix associations. By default,
the namespace prefixes for a XML namespace are generated by a
JAXB Provider in an implementation dependent way.</div>
<dl>
<dt>Default:</dt>
<dd>{}</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="namespace--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>namespace</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;namespace</pre>
<div class="block">Name of the XML namespace.</div>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="elementFormDefault--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>elementFormDefault</h4>
<pre>public abstract&nbsp;<a href="../../../../jakarta/xml/bind/annotation/XmlNsForm.html" title="enum in jakarta.xml.bind.annotation">XmlNsForm</a>&nbsp;elementFormDefault</pre>
<div class="block">Namespace qualification for elements. By default, element
default attribute will be absent from the XML Schema fragment.</div>
<dl>
<dt>Default:</dt>
<dd>jakarta.xml.bind.annotation.XmlNsForm.UNSET</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="attributeFormDefault--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>attributeFormDefault</h4>
<pre>public abstract&nbsp;<a href="../../../../jakarta/xml/bind/annotation/XmlNsForm.html" title="enum in jakarta.xml.bind.annotation">XmlNsForm</a>&nbsp;attributeFormDefault</pre>
<div class="block">Namespace qualification for attributes. By default,
attributesFormDefault will be absent from the XML Schema fragment.</div>
<dl>
<dt>Default:</dt>
<dd>jakarta.xml.bind.annotation.XmlNsForm.UNSET</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="location--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>location</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;location</pre>
<div class="block">Indicates that this namespace (specified by <a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#namespace--"><code>namespace()</code></a>)
has a schema already available exeternally, available at this location.
<p>
This instructs the JAXB schema generators to simply refer to
the pointed schema, as opposed to generating components into the schema.
This schema is assumed to match what would be otherwise produced
by the schema generator (same element names, same type names...)
<p>
This feature is intended to be used when a set of the Java classes
is originally generated from an existing schema, hand-written to
match externally defined schema, or the generated schema is modified
manually.
<p>
Value could be any absolute URI, like <code>http://example.org/some.xsd</code>.
It is also possible to specify the empty string, to indicate
that the schema is externally available but the location is
unspecified (and thus it's the responsibility of the reader of the generate
schema to locate it.) Finally, the default value of this property
<code>"##generate"</code> indicates that the schema generator is going
to generate components for this namespace (as it did in JAXB 2.0.)
<p>
Multiple <a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html" title="annotation in jakarta.xml.bind.annotation"><code>XmlSchema</code></a> annotations on multiple packages are allowed
to govern the same <a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#namespace--"><code>namespace()</code></a>. In such case, all of them
must have the same <a href="../../../../jakarta/xml/bind/annotation/XmlSchema.html#location--"><code>location()</code></a> values.
<p>
<strong>Note to implementor</strong>
<p>
More precisely, the value must be either <code>""</code>, <code>"##generate"</code>, or
<a href="http://www.w3.org/TR/xmlschema-2/#anyURI">
a valid lexical representation of <code>xs:anyURI</code></a> that begins
with <code>&lt;scheme&gt;:</code>.
<p>
A schema generator is expected to generate a corresponding
<code>&lt;xs:import namespace="..." schemaLocation="..."/&gt;</code> (or
no <code>schemaLocation</code> attribute at all if the empty string is specified.)
However, the schema generator is allowed to use a different value in
the <code>schemaLocation</code> attribute (including not generating
such attribute), for example so that the user can specify a local
copy of the resource through the command line interface.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.6, JAXB 2.1</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>"##generate"</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../jakarta/xml/bind/annotation/XmlRootElement.html" title="annotation in jakarta.xml.bind.annotation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../jakarta/xml/bind/annotation/XmlSchemaType.html" title="annotation in jakarta.xml.bind.annotation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?jakarta/xml/bind/annotation/XmlSchema.html" target="_top">Frames</a></li>
<li><a href="XmlSchema.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#annotation.type.field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Required&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#annotation.type.field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>