| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 --> |
| <title>ValueConverter (Apache SIS 1.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2019-09-20"> |
| <meta name="keywords" content="org.apache.sis.xml.ValueConverter class"> |
| <meta name="keywords" content="DEFAULT"> |
| <meta name="keywords" content="exceptionOccured()"> |
| <meta name="keywords" content="toLanguageCode()"> |
| <meta name="keywords" content="toCountryCode()"> |
| <meta name="keywords" content="toCharsetCode()"> |
| <meta name="keywords" content="toLocale()"> |
| <meta name="keywords" content="toCharset()"> |
| <meta name="keywords" content="toUnit()"> |
| <meta name="keywords" content="toUUID()"> |
| <meta name="keywords" content="toURI()"> |
| <meta name="keywords" content="toURL()"> |
| <meta name="keywords" content="toNilReason()"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../sis.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="ValueConverter (Apache SIS 1.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = false; |
| 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="class-use/ValueConverter.html">Use</a></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" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All 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: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </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> <a href="package-summary.html">org.apache.sis.xml</a></div> |
| <h2 title="Class ValueConverter" class="title">Class ValueConverter</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>ValueConverter</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public class <span class="typeNameLabel">ValueConverter</span> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></pre> |
| <div class="block">Performs conversions of XML element or attribute values encountered during XML (un)marshalling. |
| Each method in this class is a converter and can be invoked at (un)marshalling time. |
| The default implementation is straightforward and documented in the javadoc of each method. |
| |
| <p>This class provides a way to handle the errors which may exist in some XML documents. |
| For example a URL in the document may be malformed, causing a <a href="https://docs.oracle.com/javase/8/docs/api/java/net/MalformedURLException.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>MalformedURLException</code></a> |
| to be thrown. If this error is not handled, it will cause the (un)marshalling of the entire |
| document to fail. An application may want to change this behavior by replacing URLs that |
| are known to be erroneous by fixed versions of those URLs. Example:</p> |
| |
| <blockquote><pre><font color="green">class</font> URLFixer <font color="green">extends</font> ValueConverter { |
| @Override |
| <font color="green">public</font> URL <b>toURL</b>(MarshalContext context, URI uri) <font color="green">throws</font> MalformedURLException { |
| <font color="green">try</font> { |
| <font color="green">return</font> <font color="green">super</font>.<b>toURL</b>(context, uri); |
| } <font color="green">catch</font> (MalformedURLException e) { |
| <font color="green">if</font> (uri.<b>equals</b>(KNOWN_ERRONEOUS_URI) { |
| <font color="green">return</font> FIXED_URL; |
| } <font color="green">else</font> { |
| <font color="green">throw</font> e; |
| } |
| } |
| } |
| }</pre></blockquote> |
| |
| See the <a href="XML.html#CONVERTER"><code>XML.CONVERTER</code></a> javadoc for an example of registering a custom |
| <code>ValueConverter</code> to a (un)marshaller.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.3</dd> |
| |
| <p><font size="-1">Defined in the <code>sis-metadata</code> module</font></p> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="ValueConverter.html" title="class in org.apache.sis.xml">ValueConverter</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DEFAULT">DEFAULT</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">The default, thread-safe and immutable instance.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier</th> |
| <th class="colSecond" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected </code></td> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">ValueConverter</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a default <code>ValueConverter</code>.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>protected <T> boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#exceptionOccured(org.apache.sis.xml.MarshalContext,T,java.lang.Class,java.lang.Class,java.lang.Exception)">exceptionOccured</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| T value, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><T> sourceType, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><?> targetType, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang" class="externalLink">Exception</a> exception)</code></th> |
| <td class="colLast"> |
| <div class="block">Invoked when an exception occurred in any <code>toXXX(…)</code> method.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset" class="externalLink">Charset</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toCharset(org.apache.sis.xml.MarshalContext,java.lang.String)">toCharset</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given string to a character set.</div> |
| </td> |
| </tr> |
| <tr id="i2" 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="#toCharsetCode(org.apache.sis.xml.MarshalContext,java.nio.charset.Charset)">toCharsetCode</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset" class="externalLink">Charset</a> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given character set to a code.</div> |
| </td> |
| </tr> |
| <tr id="i3" 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="#toCountryCode(org.apache.sis.xml.MarshalContext,java.util.Locale)">toCountryCode</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util" class="externalLink">Locale</a> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given locale to a country code.</div> |
| </td> |
| </tr> |
| <tr id="i4" 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="#toLanguageCode(org.apache.sis.xml.MarshalContext,java.util.Locale)">toLanguageCode</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util" class="externalLink">Locale</a> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given locale to a language code.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util" class="externalLink">Locale</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toLocale(org.apache.sis.xml.MarshalContext,java.lang.String)">toLocale</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given string to a locale.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code><a href="NilReason.html" title="class in org.apache.sis.xml">NilReason</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toNilReason(org.apache.sis.xml.MarshalContext,java.lang.String)">toNilReason</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given string to a <code>NilReason</code>.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html?is-external=true" title="class or interface in javax.measure" class="externalLink">Unit</a><?></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toUnit(org.apache.sis.xml.MarshalContext,java.lang.String)">toUnit</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given string to a unit.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink">URI</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toURI(org.apache.sis.xml.MarshalContext,java.lang.String)">toURI</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given string to a URI.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink">URI</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toURI(org.apache.sis.xml.MarshalContext,java.net.URL)">toURI</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink">URL</a> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given URL to a URI.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink">URL</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toURL(org.apache.sis.xml.MarshalContext,java.net.URI)">toURL</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink">URI</a> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given URI to a URL.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util" class="externalLink">UUID</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toUUID(org.apache.sis.xml.MarshalContext,java.lang.String)">toUUID</a></span>​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value)</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the given string to a Universal Unique Identifier.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="DEFAULT"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>DEFAULT</h4> |
| <pre>public static final <a href="ValueConverter.html" title="class in org.apache.sis.xml">ValueConverter</a> DEFAULT</pre> |
| <div class="block">The default, thread-safe and immutable instance. This instance defines the |
| converters used during every (un)marshalling if no <code>ValueConverter</code> |
| was explicitly set.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>ValueConverter</h4> |
| <pre>protected ValueConverter()</pre> |
| <div class="block">Creates a default <code>ValueConverter</code>. This is for subclasses only, |
| since new instances are useful only if at least one method is overridden.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="exceptionOccured(org.apache.sis.xml.MarshalContext,java.lang.Object,java.lang.Class,java.lang.Class,java.lang.Exception)"> |
| <!-- --> |
| </a><a id="exceptionOccured(org.apache.sis.xml.MarshalContext,T,java.lang.Class,java.lang.Class,java.lang.Exception)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>exceptionOccured</h4> |
| <pre class="methodSignature">protected <T> boolean exceptionOccured​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| T value, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><T> sourceType, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><?> targetType, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang" class="externalLink">Exception</a> exception)</pre> |
| <div class="block">Invoked when an exception occurred in any <code>toXXX(…)</code> method. The default implementation |
| does nothing and return <code>false</code>, which will cause the (un)marshalling process of the |
| whole XML document to fail. |
| |
| <p>This method provides a single hook that subclasses can override in order to provide their |
| own error handling for every methods defined in this class, like the example documented in |
| the <a href="XML.html#CONVERTER"><code>XML.CONVERTER</code></a> javadoc. Subclasses also have the possibility to override individual |
| <code>toXXX(…)</code> methods, like the example provided in this <a href="#skip-navbar_top">class |
| javadoc</a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - the compile-time type of the <code>sourceType</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the value that can't be converted.</dd> |
| <dd><code>sourceType</code> - the base type of the value to convert. This is determined by the argument type of the method |
| that caught the exception. For example the source type is always <code>URI.class</code> |
| if the exception has been caught by the <a href="#toURL(org.apache.sis.xml.MarshalContext,java.net.URI)"><code>toURL(MarshalContext, URI)</code></a> method.</dd> |
| <dd><code>targetType</code> - the expected type of the converted object.</dd> |
| <dd><code>exception</code> - the exception that occurred during the conversion attempt.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the (un)marshalling process should continue despite this error, |
| or <code>false</code> (the default) if the exception should be propagated, thus causing |
| the (un)marshalling to fail.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toLanguageCode(org.apache.sis.xml.MarshalContext,java.util.Locale)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toLanguageCode</h4> |
| <pre class="methodSignature">public <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> toLanguageCode​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util" class="externalLink">Locale</a> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/util/MissingResourceException.html?is-external=true" title="class or interface in java.util" class="externalLink">MissingResourceException</a></pre> |
| <div class="block">Converts the given locale to a language code. For better compliance with ISO standards, the language code |
| should be a 3-letters ISO 639-2 code (e.g. <code>"jpn"</code> for <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true#JAPANESE" title="class or interface in java.util" class="externalLink">Japanese</a>). |
| However those codes may not be available for every locales. |
| |
| <p>The default implementation performs the following steps:</p> |
| <ul> |
| <li>Try <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true#getISO3Language()" title="class or interface in java.util" class="externalLink"><code>Locale.getISO3Language()</code></a>:<ul> |
| <li>On success, return that value if non-empty, or <code>null</code> otherwise.</li> |
| <li>If an exception has been thrown, then:<ul> |
| <li>If <a href="#exceptionOccured(org.apache.sis.xml.MarshalContext,T,java.lang.Class,java.lang.Class,java.lang.Exception)"><code>exceptionOccured(…)</code></a> return <code>true</code>, then |
| returns <code>value.getLanguage()</code> if non-empty or <code>null</code> otherwise.</li> |
| <li>If <code>exceptionOccured(…)</code> returned <code>false</code> (which is the default |
| behavior), then let the exception propagate.</li> |
| </ul></li> |
| </ul></li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the locale to convert to a language code, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the language code, or <code>null</code> if the given value was null or does not contains a language code.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/MissingResourceException.html?is-external=true" title="class or interface in java.util" class="externalLink">MissingResourceException</a></code> - if no language code can be found for the given locale.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true#getISO3Language()" title="class or interface in java.util" class="externalLink"><code>Locale.getISO3Language()</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true#getLanguage()" title="class or interface in java.util" class="externalLink"><code>Locale.getLanguage()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toCountryCode(org.apache.sis.xml.MarshalContext,java.util.Locale)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toCountryCode</h4> |
| <pre class="methodSignature">public <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> toCountryCode​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util" class="externalLink">Locale</a> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/util/MissingResourceException.html?is-external=true" title="class or interface in java.util" class="externalLink">MissingResourceException</a></pre> |
| <div class="block">Converts the given locale to a country code. For better compliance with ISO standards, the country code |
| should be a 2-letters ISO 3166 code (e.g. <code>"JP"</code> for <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true#JAPAN" title="class or interface in java.util" class="externalLink">Japan</a>). |
| |
| <p>The default implementation returns <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true#getCountry()" title="class or interface in java.util" class="externalLink"><code>Locale.getCountry()</code></a> if non-empty, or <code>null</code> otherwise.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the locale to convert to a country code, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the country code, or <code>null</code> if the given value was null or does not contains a country code.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/MissingResourceException.html?is-external=true" title="class or interface in java.util" class="externalLink">MissingResourceException</a></code> - if no country code can be found for the given locale.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true#getISO3Country()" title="class or interface in java.util" class="externalLink"><code>Locale.getISO3Country()</code></a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true#getCountry()" title="class or interface in java.util" class="externalLink"><code>Locale.getCountry()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toCharsetCode(org.apache.sis.xml.MarshalContext,java.nio.charset.Charset)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toCharsetCode</h4> |
| <pre class="methodSignature">public <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> toCharsetCode​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset" class="externalLink">Charset</a> value)</pre> |
| <div class="block">Converts the given character set to a code. |
| |
| <p>The default implementation first invokes <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true#name()" title="class or interface in java.nio.charset" class="externalLink"><code>Charset.name()</code></a>. Then if marshalling to legacy ISO 19139:2007, |
| this method converts the <a href="http://www.iana.org/assignments/character-sets">IANA</a> name to a |
| ISO 19115:2003 <code>MD_CharacterSetCode</code> using the following equivalence table:</p> |
| |
| <table class="sis"> |
| <caption>IANA to ISO 19115:2003 character set code</caption> |
| <tr> |
| <td><table class="compact"> |
| <caption>From ISO codes</caption> |
| <tr><td style="width: 90px"><b>IANA</b></td><td><b>ISO 19115:2003</b></td></tr> |
| <tr><td><code>ISO-8859-1</code></td> <td><code>8859part1</code></td></tr> |
| <tr><td><code>ISO-8859-2</code></td> <td><code>8859part2</code></td></tr> |
| <tr><td><code>ISO-8859-3</code></td> <td><code>8859part3</code></td></tr> |
| <tr><td><code>ISO-8859-4</code></td> <td><code>8859part4</code></td></tr> |
| <tr><td><code>ISO-8859-5</code></td> <td><code>8859part5</code></td></tr> |
| <tr><td><code>ISO-8859-6</code></td> <td><code>8859part6</code></td></tr> |
| <tr><td><code>ISO-8859-7</code></td> <td><code>8859part7</code></td></tr> |
| <tr><td><code>ISO-8859-8</code></td> <td><code>8859part8</code></td></tr> |
| <tr><td><code>ISO-8859-9</code></td> <td><code>8859part9</code></td></tr> |
| <tr><td><code>ISO-8859-10</code></td> <td><code>8859part10</code></td></tr> |
| <tr><td><code>ISO-8859-11</code></td> <td><code>8859part11</code></td></tr> |
| <tr><td><code>ISO-8859-12</code></td> <td><code>8859part12</code></td></tr> |
| <tr><td><code>ISO-8859-13</code></td> <td><code>8859part13</code></td></tr> |
| <tr><td><code>ISO-8859-14</code></td> <td><code>8859part14</code></td></tr> |
| <tr><td><code>ISO-8859-15</code></td> <td><code>8859part15</code></td></tr> |
| <tr><td><code>ISO-8859-16</code></td> <td><code>8859part16</code></td></tr> |
| </table></td> |
| <td class="sep"><table class="compact"> |
| <caption>Others</caption> |
| <tr><td style="width: 90px"><b>IANA</b></td><td><b>ISO 19115:2003</b></td></tr> |
| <tr><td><code>UCS-2</code></td> <td><code>ucs2</code></td></tr> |
| <tr><td><code>UCS-4</code></td> <td><code>ucs4</code></td></tr> |
| <tr><td><code>UTF-7</code></td> <td><code>utf7</code></td></tr> |
| <tr><td><code>UTF-8</code></td> <td><code>utf8</code></td></tr> |
| <tr><td><code>UTF-16</code></td> <td><code>utf16</code></td></tr> |
| <tr><td><code>JIS_X0201</code></td> <td><code>jis</code></td></tr> |
| <tr><td><code>Shift_JIS</code></td> <td><code>shiftJIS</code></td></tr> |
| <tr><td><code>EUC-JP</code></td> <td><code>eucJP</code></td></tr> |
| <tr><td><code>US-ASCII</code></td> <td><code>usAscii</code></td></tr> |
| <tr><td><code>EBCDIC</code></td> <td><code>ebcdic</code></td></tr> |
| <tr><td><code>EUC-KR</code></td> <td><code>eucKR</code></td></tr> |
| <tr><td><code>Big5</code></td> <td><code>big5</code></td></tr> |
| <tr><td><code>GB2312</code></td> <td><code>GB2312</code></td></tr> |
| </table></td> |
| </tr> |
| </table></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the locale to convert to a character set code, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the country code, or <code>null</code> if the given value was null.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.5</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true#name()" title="class or interface in java.nio.charset" class="externalLink"><code>Charset.name()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toLocale(org.apache.sis.xml.MarshalContext,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toLocale</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util" class="externalLink">Locale</a> toLocale​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/util/IllformedLocaleException.html?is-external=true" title="class or interface in java.util" class="externalLink">IllformedLocaleException</a></pre> |
| <div class="block">Converts the given string to a locale. The string is the language code either as the 2 |
| letters or the 3 letters ISO code. It can optionally be followed by the <code>'_'</code> |
| character and the country code (again either as 2 or 3 letters), optionally followed |
| by <code>'_'</code> and the variant.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the string to convert to a locale, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the converted locale, or <code>null</code> if the given value was null or empty, or |
| if an exception was thrown and <code>exceptionOccured(…)</code> returned <code>true</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/IllformedLocaleException.html?is-external=true" title="class or interface in java.util" class="externalLink">IllformedLocaleException</a></code> - if the given string can not be converted to a locale.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../util/Locales.html#parse(java.lang.String)"><code>Locales.parse(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toCharset(org.apache.sis.xml.MarshalContext,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toCharset</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset" class="externalLink">Charset</a> toCharset​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/IllegalCharsetNameException.html?is-external=true" title="class or interface in java.nio.charset" class="externalLink">IllegalCharsetNameException</a></pre> |
| <div class="block">Converts the given string to a character set. The string can be either a |
| <a href="http://www.iana.org/assignments/character-sets">IANA</a> identifier, |
| or one of the ISO 19115:2003 <code>MD_CharacterSetCode</code> identifier.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the string to convert to a character set, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the converted character set, or <code>null</code> if the given value was null or empty, or |
| if an exception was thrown and <code>exceptionOccured(…)</code> returned <code>true</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/IllegalCharsetNameException.html?is-external=true" title="class or interface in java.nio.charset" class="externalLink">IllegalCharsetNameException</a></code> - if the given string can not be converted to a character set.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.5</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true#forName(java.lang.String)" title="class or interface in java.nio.charset" class="externalLink"><code>Charset.forName(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toUnit(org.apache.sis.xml.MarshalContext,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toUnit</h4> |
| <pre class="methodSignature">public <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html?is-external=true" title="class or interface in javax.measure" class="externalLink">Unit</a><?> toUnit​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></pre> |
| <div class="block">Converts the given string to a unit. The default implementation is as below, omitting |
| the check for null value and the call to <a href="#exceptionOccured(org.apache.sis.xml.MarshalContext,T,java.lang.Class,java.lang.Class,java.lang.Exception)"><code>exceptionOccured(…)</code></a> |
| in case of error: |
| |
| <blockquote><pre><font color="green">return</font> Units.<b>valueOf</b>(value);</pre></blockquote></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the string to convert to a unit, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the converted unit, or <code>null</code> if the given value was null or empty, or |
| if an exception was thrown and <code>exceptionOccured(…)</code> returned <code>true</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if the given string can not be converted to a unit.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../measure/Units.html#valueOf(java.lang.String)"><code>Units.valueOf(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toUUID(org.apache.sis.xml.MarshalContext,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toUUID</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util" class="externalLink">UUID</a> toUUID​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></pre> |
| <div class="block">Converts the given string to a Universal Unique Identifier. The default implementation |
| is as below, omitting the check for null value and the call to <a href="#exceptionOccured(org.apache.sis.xml.MarshalContext,T,java.lang.Class,java.lang.Class,java.lang.Exception)"><code>exceptionOccured(…)</code></a> in case of error: |
| |
| <blockquote><pre><font color="green">return</font> UUID.<b>fromString</b>(value);</pre></blockquote></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the string to convert to a UUID, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the converted UUID, or <code>null</code> if the given value was null or empty, or |
| if an exception was thrown and <code>exceptionOccured(…)</code> returned <code>true</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if the given string can not be converted to a UUID.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html?is-external=true#fromString(java.lang.String)" title="class or interface in java.util" class="externalLink"><code>UUID.fromString(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toURI(org.apache.sis.xml.MarshalContext,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toURI</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink">URI</a> toURI​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URISyntaxException.html?is-external=true" title="class or interface in java.net" class="externalLink">URISyntaxException</a></pre> |
| <div class="block">Converts the given string to a URI. The default performs the following work |
| (omitting the check for null value and the call to <a href="#exceptionOccured(org.apache.sis.xml.MarshalContext,T,java.lang.Class,java.lang.Class,java.lang.Exception)"><code>exceptionOccured(…)</code></a> in case of error): |
| |
| <blockquote><pre><font color="green">return</font> <font color="green">new</font> <b>URI</b>(value);</pre></blockquote></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the string to convert to a URI, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the converted URI, or <code>null</code> if the given value was null or empty, or if |
| an exception was thrown and <code>exceptionOccured(…)</code> returned <code>true</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URISyntaxException.html?is-external=true" title="class or interface in java.net" class="externalLink">URISyntaxException</a></code> - if the given string can not be converted to a URI.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true#%3Cinit%3E(java.lang.String)" title="class or interface in java.net" class="externalLink"><code>URI(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toURI(org.apache.sis.xml.MarshalContext,java.net.URL)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toURI</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink">URI</a> toURI​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink">URL</a> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URISyntaxException.html?is-external=true" title="class or interface in java.net" class="externalLink">URISyntaxException</a></pre> |
| <div class="block">Converts the given URL to a URI. The default implementation is as below, omitting |
| the check for null value and the call to <a href="#exceptionOccured(org.apache.sis.xml.MarshalContext,T,java.lang.Class,java.lang.Class,java.lang.Exception)"><code>exceptionOccured(…)</code></a> |
| in case of error: |
| |
| <blockquote><pre><font color="green">return</font> value.<b>toURI</b>();</pre></blockquote></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the URL to convert to a URI, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the converted URI, or <code>null</code> if the given value was null or if an |
| exception was thrown and <code>exceptionOccured(…)</code> returned <code>true</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URISyntaxException.html?is-external=true" title="class or interface in java.net" class="externalLink">URISyntaxException</a></code> - if the given URL can not be converted to a URI.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true#toURI()" title="class or interface in java.net" class="externalLink"><code>URL.toURI()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toURL(org.apache.sis.xml.MarshalContext,java.net.URI)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toURL</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net" class="externalLink">URL</a> toURL​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink">URI</a> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/net/MalformedURLException.html?is-external=true" title="class or interface in java.net" class="externalLink">MalformedURLException</a></pre> |
| <div class="block">Converts the given URI to a URL. The default implementation is as below, omitting |
| the check for null value and the call to <a href="#exceptionOccured(org.apache.sis.xml.MarshalContext,T,java.lang.Class,java.lang.Class,java.lang.Exception)"><code>exceptionOccured(…)</code></a> |
| in case of error: |
| |
| <blockquote><pre><font color="green">return</font> value.<b>toURL</b>();</pre></blockquote></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the URI to convert to a URL, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the converted URL, or <code>null</code> if the given value was null or if an |
| exception was thrown and <code>exceptionOccured(…)</code> returned <code>true</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/net/MalformedURLException.html?is-external=true" title="class or interface in java.net" class="externalLink">MalformedURLException</a></code> - if the given URI can not be converted to a URL.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true#toURL()" title="class or interface in java.net" class="externalLink"><code>URI.toURL()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toNilReason(org.apache.sis.xml.MarshalContext,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>toNilReason</h4> |
| <pre class="methodSignature">public <a href="NilReason.html" title="class in org.apache.sis.xml">NilReason</a> toNilReason​(<a href="MarshalContext.html" title="class in org.apache.sis.xml">MarshalContext</a> context, |
| <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> value) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URISyntaxException.html?is-external=true" title="class or interface in java.net" class="externalLink">URISyntaxException</a></pre> |
| <div class="block">Converts the given string to a <code>NilReason</code>. The default implementation is as below, |
| omitting the check for null value and the call to <a href="#exceptionOccured(org.apache.sis.xml.MarshalContext,T,java.lang.Class,java.lang.Class,java.lang.Exception)"><code>exceptionOccured(…)</code></a> |
| in case of error: |
| |
| <blockquote><pre><font color="green">return</font> NilReason.<b>valueOf</b>(value);</pre></blockquote></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.</dd> |
| <dd><code>value</code> - the string to convert to a nil reason, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the converted nil reason, or <code>null</code> if the given value was null or empty, or |
| if an exception was thrown and <code>exceptionOccured(…)</code> returned <code>true</code>.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/net/URISyntaxException.html?is-external=true" title="class or interface in java.net" class="externalLink">URISyntaxException</a></code> - if the given string can not be converted to a nil reason.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="NilReason.html#valueOf(java.lang.String)"><code>NilReason.valueOf(String)</code></a></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="class-use/ValueConverter.html">Use</a></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" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All 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: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2010–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |