blob: 80409005366a6b7469f34562133b0b3b089f2add [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.2) on Wed Apr 22 10:19:16 CDT 2020 -->
<title>XmlSchema (EclipseLink 3.0.0, API Reference)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-04-22">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="XmlSchema (EclipseLink 3.0.0, API Reference)";
}
}
catch(err) {
}
//-->
var pathtoroot = "../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.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 class="aboutLanguage">EclipseLink 3.0.0, API Reference</div>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</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 id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">jakarta.xml.bind.annotation</a></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>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Retention</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation" class="externalLink">RUNTIME</a>)
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Target</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/ElementType.html?is-external=true#PACKAGE" title="class or interface in java.lang.annotation" class="externalLink">PACKAGE</a>)
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">Author:</span></dt>
<dd>Sekhar Vajjhala, Sun Microsystems, Inc.</dd>
<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 =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="annotation.type.field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Fields</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#NO_LOCATION">NO_LOCATION</a></span></code></th>
<td class="colLast">
<div class="block">The default value of the <a href="#location()"><code>location()</code></a> attribute,
which indicates that the schema generator will generate
components in this namespace.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="annotation.type.optional.element.summary">
<!-- -->
</a>
<h3>Optional Element Summary</h3>
<table class="memberSummary">
<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Optional Element</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="XmlNsForm.html" title="enum in jakarta.xml.bind.annotation">XmlNsForm</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#attributeFormDefault()">attributeFormDefault</a></span></code></th>
<td class="colLast">
<div class="block">Namespace qualification for attributes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="XmlNsForm.html" title="enum in jakarta.xml.bind.annotation">XmlNsForm</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#elementFormDefault()">elementFormDefault</a></span></code></th>
<td class="colLast">
<div class="block">Namespace qualification for elements.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#location()">location</a></span></code></th>
<td class="colLast">
<div class="block">Indicates that this namespace (specified by <a href="#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><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#namespace()">namespace</a></span></code></th>
<td class="colLast">
<div class="block">Name of the XML namespace.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="XmlNs.html" title="annotation in jakarta.xml.bind.annotation">XmlNs</a>[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#xmlns()">xmlns</a></span></code></th>
<td class="colLast">
<div class="block">Customize the namespace URI, prefix associations.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="annotation.type.field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="NO_LOCATION">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NO_LOCATION</h4>
<pre>static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;NO_LOCATION</pre>
<div class="block">The default value of the <a href="#location()"><code>location()</code></a> attribute,
which indicates that the schema generator will generate
components in this namespace.</div>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="annotation.type.element.detail">
<!-- -->
</a>
<h3>Element Detail</h3>
<a id="xmlns()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>xmlns</h4>
<pre><a href="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>
</section>
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="namespace()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>namespace</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;namespace</pre>
<div class="block">Name of the XML namespace.</div>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="elementFormDefault()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>elementFormDefault</h4>
<pre><a href="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>
</section>
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="attributeFormDefault()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>attributeFormDefault</h4>
<pre><a href="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>
</section>
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="location()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>location</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;location</pre>
<div class="block">Indicates that this namespace (specified by <a href="#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="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="#namespace()"><code>namespace()</code></a>. In such case, all of them
must have the same <a href="#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>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.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 class="aboutLanguage">EclipseLink 3.0.0, API Reference</div>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</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 id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2017&#x2013;2020 <a href="http://www.eclipse.org/eclipselink">Eclipse.org - EclipseLink Project</a>. All rights reserved.</small></p>
</footer>
</body>
</html>