| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 --> |
| <title>ModifiableMetadata (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.metadata.ModifiableMetadata class"> |
| <meta name="keywords" content="state()"> |
| <meta name="keywords" content="transitionTo()"> |
| <meta name="keywords" content="isModifiable()"> |
| <meta name="keywords" content="unmodifiable()"> |
| <meta name="keywords" content="freeze()"> |
| <meta name="keywords" content="checkWritePermission()"> |
| <meta name="keywords" content="writeList()"> |
| <meta name="keywords" content="writeSet()"> |
| <meta name="keywords" content="writeCollection()"> |
| <meta name="keywords" content="writeMap()"> |
| <meta name="keywords" content="copyList()"> |
| <meta name="keywords" content="copySet()"> |
| <meta name="keywords" content="copyCollection()"> |
| <meta name="keywords" content="copyMap()"> |
| <meta name="keywords" content="singleton()"> |
| <meta name="keywords" content="nonNullList()"> |
| <meta name="keywords" content="nonNullSet()"> |
| <meta name="keywords" content="nonNullCollection()"> |
| <meta name="keywords" content="nonNullMap()"> |
| <meta name="keywords" content="collectionType()"> |
| <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="ModifiableMetadata (Apache SIS 1.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":42,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":42,"i8":42,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":42,"i17":10,"i18":10,"i19":10,"i20":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated 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/ModifiableMetadata.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><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </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>Field | </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.metadata</a></div> |
| <h2 title="Class ModifiableMetadata" class="title">Class ModifiableMetadata</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><a href="AbstractMetadata.html" title="class in org.apache.sis.metadata">AbstractMetadata</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>ModifiableMetadata</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="../util/Emptiable.html" title="interface in org.apache.sis.util">Emptiable</a></code>, <code><a href="../util/LenientComparable.html" title="interface in org.apache.sis.util">LenientComparable</a></code></dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><code><a href="iso/ISOMetadata.html" title="class in org.apache.sis.metadata.iso">ISOMetadata</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public abstract class <span class="typeNameLabel">ModifiableMetadata</span> |
| extends <a href="AbstractMetadata.html" title="class in org.apache.sis.metadata">AbstractMetadata</a></pre> |
| <div class="block">Base class of metadata having an editable content. |
| Newly created <code>ModifiableMetadata</code> are initially in <a href="ModifiableMetadata.State.html#EDITABLE">editable</a> state. |
| The metadata can be populated using the setter methods provided by subclasses, then transition to the |
| <a href="ModifiableMetadata.State.html#FINAL">final</a> state for making it safe to share by many consumers. |
| |
| <div class="section">Tip for subclass implementations</div> |
| Subclasses can follow the pattern below for every <code>get</code> and <code>set</code> methods, |
| with a different processing for singleton value or for <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">collections</a>. |
| |
| <blockquote><pre><font color="green">public</font> <font color="green">class</font> MyMetadata { |
| |
| <i><font color="gray">// ==== Example for a singleton value =============================</font></i> |
| |
| <font color="green">private</font> Foo property; |
| |
| <font color="green">public</font> Foo <b>getProperty</b>() { |
| <font color="green">return</font> property; |
| } |
| |
| <font color="green">public</font> <font color="green">void</font> <b>setProperty</b>(Foo newValue) { |
| <b>checkWritePermission</b>(); |
| property = newValue; |
| } |
| |
| <i><font color="gray">// ==== Example for a collection ==================================</font></i> |
| |
| <font color="green">private</font> Collection<Foo> properties; |
| |
| <font color="green">public</font> Collection<Foo> <b>getProperties</b>() { |
| <font color="green">return</font> properties = <b>nonNullCollection</b>(properties, Foo.<font color="green">class</font>); |
| } |
| |
| <font color="green">public</font> <font color="green">void</font> <b>setProperties</b>(Collection<Foo> newValues) { |
| <i><font color="gray">// the call to checkWritePermission() is implicit</font></i> |
| properties = <b>writeCollection</b>(newValues, properties, Foo.<font color="green">class</font>); |
| } |
| }</pre></blockquote></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"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Class</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="ModifiableMetadata.State.html" title="enum in org.apache.sis.metadata">ModifiableMetadata.State</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Whether the metadata is still editable or has been made final.</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()">ModifiableMetadata</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Constructs an initially empty metadata.</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><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated 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 void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#checkWritePermission()">checkWritePermission</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">Replaced by <a href="#checkWritePermission(java.lang.Object)"><code>checkWritePermission(Object)</code></a>.</div> |
| </div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#checkWritePermission(java.lang.Object)">checkWritePermission</a></span>​(<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> current)</code></th> |
| <td class="colLast"> |
| <div class="block">Checks if changes in the metadata are allowed.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>protected <E> <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><? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#collectionType(java.lang.Class)">collectionType</a></span>​(<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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the type of collection to use for the given type.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#copyCollection(java.util.Collection,java.lang.Class)">copyCollection</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a list or set with the content of the <code>source</code> collection, |
| or returns <code>null</code> if the source is <code>null</code> or empty.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#copyList(java.util.Collection,java.lang.Class)">copyList</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a list with the content of the <code>source</code> collection, |
| or returns <code>null</code> if the source is <code>null</code> or empty.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>protected <K,​V><br><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#copyMap(java.util.Map,java.lang.Class)">copyMap</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><? extends K,​? extends V> source, |
| <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><K> keyType)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a map with the content of the <code>source</code> map, |
| or returns <code>null</code> if the source is <code>null</code> or empty.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#copySet(java.util.Collection,java.lang.Class)">copySet</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a set with the content of the <code>source</code> collection, |
| or returns <code>null</code> if the source is <code>null</code> or empty.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#freeze()">freeze</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">Replaced by <code>transition(State.FINAL)</code>.</div> |
| </div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isModifiable()">isModifiable</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">Replaced by <code><a href="#state()">state()</a> !</div> |
| </div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#nonNullCollection(java.util.Collection,java.lang.Class)">nonNullCollection</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E> current, |
| <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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the specified collection, or a new one if <code>current</code> is null.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#nonNullList(java.util.List,java.lang.Class)">nonNullList</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E> current, |
| <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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the specified list, or a new one if <code>current</code> is null.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>protected <K,​V><br><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#nonNullMap(java.util.Map,java.lang.Class)">nonNullMap</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V> current, |
| <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><K> keyType)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the specified map, or a new one if <code>current</code> is null.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#nonNullSet(java.util.Set,java.lang.Class)">nonNullSet</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E> current, |
| <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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the specified set, or a new one if <code>current</code> is null.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#singleton(E,java.lang.Class)">singleton</a></span>​(E 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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a singleton list or set containing only the given value, if non-null.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code><a href="ModifiableMetadata.State.html" title="enum in org.apache.sis.metadata">ModifiableMetadata.State</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#state()">state</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Tells whether this instance of metadata is editable.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#transitionTo(org.apache.sis.metadata.ModifiableMetadata.State)">transitionTo</a></span>​(<a href="ModifiableMetadata.State.html" title="enum in org.apache.sis.metadata">ModifiableMetadata.State</a> target)</code></th> |
| <td class="colLast"> |
| <div class="block">Requests this metadata instance and (potentially) all its children to transition to a new state.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code><a href="AbstractMetadata.html" title="class in org.apache.sis.metadata">AbstractMetadata</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#unmodifiable()">unmodifiable</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">Replaced by <code>MetadataCopier.forModifiable(getStandard()).copy(this).transition(State.FINAL)</code>.</div> |
| </div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#writeCollection(java.util.Collection,java.util.Collection,java.lang.Class)">writeCollection</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E> target, |
| <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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Writes the content of the <code>source</code> collection into the <code>target</code> list or set, |
| creating it if needed.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#writeList(java.util.Collection,java.util.List,java.lang.Class)">writeList</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E> target, |
| <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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Writes the content of the <code>source</code> collection into the <code>target</code> list, |
| creating it if needed.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>protected <K,​V><br><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#writeMap(java.util.Map,java.util.Map,java.lang.Class)">writeMap</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><? extends K,​? extends V> source, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V> target, |
| <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><K> keyType)</code></th> |
| <td class="colLast"> |
| <div class="block">Writes the content of the <code>source</code> map into the <code>target</code> map, |
| creating it if needed.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>protected <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#writeSet(java.util.Collection,java.util.Set,java.lang.Class)">writeSet</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E> target, |
| <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><E> elementType)</code></th> |
| <td class="colLast"> |
| <div class="block">Writes the content of the <code>source</code> collection into the <code>target</code> set, |
| creating it if needed.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.AbstractMetadata"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="AbstractMetadata.html" title="class in org.apache.sis.metadata">AbstractMetadata</a></h3> |
| <code><a href="AbstractMetadata.html#asMap()">asMap</a>, <a href="AbstractMetadata.html#asTreeTable()">asTreeTable</a>, <a href="AbstractMetadata.html#equals(java.lang.Object)">equals</a>, <a href="AbstractMetadata.html#equals(java.lang.Object,org.apache.sis.util.ComparisonMode)">equals</a>, <a href="AbstractMetadata.html#getInterface()">getInterface</a>, <a href="AbstractMetadata.html#getStandard()">getStandard</a>, <a href="AbstractMetadata.html#hashCode()">hashCode</a>, <a href="AbstractMetadata.html#isEmpty()">isEmpty</a>, <a href="AbstractMetadata.html#prune()">prune</a>, <a href="AbstractMetadata.html#toString()">toString</a></code></li> |
| </ul> |
| <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#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#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#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"> |
| <!-- ========= 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>ModifiableMetadata</h4> |
| <pre>protected ModifiableMetadata()</pre> |
| <div class="block">Constructs an initially empty metadata. |
| The initial state is <a href="ModifiableMetadata.State.html#EDITABLE"><code>ModifiableMetadata.State.EDITABLE</code></a>.</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="state()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>state</h4> |
| <pre class="methodSignature">public <a href="ModifiableMetadata.State.html" title="enum in org.apache.sis.metadata">ModifiableMetadata.State</a> state()</pre> |
| <div class="block">Tells whether this instance of metadata is editable. |
| This is initially <a href="ModifiableMetadata.State.html#EDITABLE"><code>ModifiableMetadata.State.EDITABLE</code></a> for new <code>ModifiableMetadata</code> instances, |
| but can be changed by a call to <a href="#transitionTo(org.apache.sis.metadata.ModifiableMetadata.State)"><code>transitionTo(State)</code></a>. |
| |
| <p><a href="ModifiableMetadata.State.html#FINAL"><code>ModifiableMetadata.State.FINAL</code></a> implies that all properties are also final. |
| This recursivity does not necessarily apply to other states. For example <a href="ModifiableMetadata.State.html#EDITABLE"><code>ModifiableMetadata.State.EDITABLE</code></a> |
| does <strong>not</strong> imply that all <code>ModifiableMetadata</code> children are also editable.</p> |
| |
| <div class="note"><b>API note:</b> |
| the <code>ModifiableMetadata</code> state is not a metadata per se, but rather an information about |
| this particular instance of a metadata class. Two metadata instances may be in different states |
| but still have the same metadata content. For this reason, this method does not have <code>get</code> |
| prefix for avoiding confusion with getter and setter methods of metadata properties.</div></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the state (editable, completable or final) of this <code>ModifiableMetadata</code> instance.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="transitionTo(org.apache.sis.metadata.ModifiableMetadata.State)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>transitionTo</h4> |
| <pre class="methodSignature">public boolean transitionTo​(<a href="ModifiableMetadata.State.html" title="enum in org.apache.sis.metadata">ModifiableMetadata.State</a> target)</pre> |
| <div class="block">Requests this metadata instance and (potentially) all its children to transition to a new state. |
| The action performed by this method depends on the <a href="#state()">source state</a> and the |
| given target state, as listed in the following table: |
| |
| <table class="sis"> |
| <caption>State transitions</caption> |
| <tr> |
| <th>Current state</th> |
| <th>Target state</th> |
| <th>Action</th> |
| </tr><tr> |
| <td><var>Any</var></td> |
| <td><var>Same</var></td> |
| <td>Does nothing and returns <code>false</code>.</td> |
| </tr><tr> |
| <td><a href="ModifiableMetadata.State.html#EDITABLE"><code>ModifiableMetadata.State.EDITABLE</code></a></td> |
| <td><a href="ModifiableMetadata.State.html#COMPLETABLE"><code>ModifiableMetadata.State.COMPLETABLE</code></a></td> |
| <td>Marks this metadata and all children as completable.</td> |
| </tr><tr> |
| <td>Any</td> |
| <td><a href="ModifiableMetadata.State.html#FINAL"><code>ModifiableMetadata.State.FINAL</code></a></td> |
| <td>Marks this metadata and all children as unmodifiable.</td> |
| </tr><tr> |
| <td><a href="ModifiableMetadata.State.html#FINAL"><code>ModifiableMetadata.State.FINAL</code></a></td> |
| <td>Any other</td> |
| <td>Throws <a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata"><code>UnmodifiableMetadataException</code></a>.</td> |
| </tr> |
| </table> |
| |
| The effect of invoking this method may be recursive. For example transitioning to <a href="ModifiableMetadata.State.html#FINAL"><code>ModifiableMetadata.State.FINAL</code></a> |
| implies transitioning all children <code>ModifiableMetadata</code> instances to the final state too.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>target</code> - the desired new state.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the state of this <code>ModifiableMetadata</code> changed as a result of this method call.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if a transition to a less restrictive state |
| (e.g. from <a href="ModifiableMetadata.State.html#FINAL"><code>ModifiableMetadata.State.FINAL</code></a> to <a href="ModifiableMetadata.State.html#EDITABLE"><code>ModifiableMetadata.State.EDITABLE</code></a>) was attempted.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isModifiable()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isModifiable</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a> |
| public final boolean isModifiable()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">Replaced by <code><a href="#state()">state()</a> != State.FINAL</code>. |
| See <a href="https://issues.apache.org/jira/browse/SIS-81">SIS-81</a>.</div> |
| </div> |
| <div class="block">Returns <code>true</code> if this metadata is modifiable. This method returns |
| <code>false</code> if <a href="#freeze()"><code>freeze()</code></a> has been invoked on this object.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if this metadata is modifiable.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#freeze()"><code>freeze()</code></a>, |
| <a href="#checkWritePermission()"><code>checkWritePermission()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="unmodifiable()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>unmodifiable</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a> |
| public <a href="AbstractMetadata.html" title="class in org.apache.sis.metadata">AbstractMetadata</a> unmodifiable()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">Replaced by <code>MetadataCopier.forModifiable(getStandard()).copy(this).transition(State.FINAL)</code>.</div> |
| </div> |
| <div class="block">Returns an unmodifiable copy of this metadata. Any attempt to modify a property of the |
| returned object will throw an <a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata"><code>UnmodifiableMetadataException</code></a>. The state of this |
| object is not modified. |
| |
| <p>This method is useful for reusing the same metadata object as a template. |
| For example:</p> |
| |
| <blockquote><pre>DefaultCitation myCitation = <font color="green">new</font> <b>DefaultCitation</b>(); |
| myCitation.<b>setTitle</b>(<font color="green">new</font> <b>SimpleInternationalString</b>(<font color="orangered">"The title of my book"</font>)); |
| myCitation.<b>setEdition</b>(<font color="green">new</font> <b>SimpleInternationalString</b>(<font color="orangered">"First edition"</font>)); |
| <font color="green">final</font> Citation firstEdition = (Citation) myCitation.<b>unmodifiable</b>(); |
| |
| myCitation.<b>setEdition</b>(<font color="green">new</font> <b>SimpleInternationalString</b>(<font color="orangered">"Second edition"</font>)); |
| <font color="green">final</font> Citation secondEdition = (Citation) myCitation.<b>unmodifiable</b>(); |
| <i><font color="gray">// The title of the second edition is unchanged compared to the first edition.</font></i></pre></blockquote> |
| |
| The default implementation makes the following choice: |
| |
| <ul> |
| <li>If this metadata is itself unmodifiable, then this method returns <code>this</code> unchanged.</li> |
| <li>Otherwise this method <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> this metadata and |
| <a href="#freeze()">freeze</a> the clone before to return it.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an unmodifiable copy of this metadata.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="MetadataCopier.html" title="class in org.apache.sis.metadata"><code>MetadataCopier</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="freeze()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>freeze</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a> |
| public void freeze()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">Replaced by <code>transition(State.FINAL)</code>.</div> |
| </div> |
| <div class="block">Declares this metadata and all its properties as unmodifiable. Any attempt to modify a |
| property after this method call will throw an <a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata"><code>UnmodifiableMetadataException</code></a>. |
| If this metadata is already unmodifiable, then this method does nothing. |
| |
| <p>Subclasses usually do not need to override this method since the default implementation |
| performs its work using Java reflection.</p></div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#state()"><code>state()</code></a>, |
| <a href="#checkWritePermission()"><code>checkWritePermission()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="checkWritePermission()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkWritePermission</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a> |
| protected void checkWritePermission() |
| throws <a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">Replaced by <a href="#checkWritePermission(java.lang.Object)"><code>checkWritePermission(Object)</code></a>.</div> |
| </div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="checkWritePermission(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkWritePermission</h4> |
| <pre class="methodSignature">protected void checkWritePermission​(<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> current) |
| throws <a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></pre> |
| <div class="block">Checks if changes in the metadata are allowed. All <code>setFoo(…)</code> methods in subclasses |
| shall invoke this method (directly or indirectly) before to apply any change. |
| The current property value should be specified in argument.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>current</code> - the current value, or <code>null</code> if none.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#state()"><code>state()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="writeList(java.util.Collection,java.util.List,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>writeList</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E> writeList​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E> target, |
| <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><E> elementType) |
| throws <a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></pre> |
| <div class="block">Writes the content of the <code>source</code> collection into the <code>target</code> list, |
| creating it if needed. This method performs the following steps: |
| |
| <ul> |
| <li>Invokes <a href="#checkWritePermission(java.lang.Object)"><code>checkWritePermission(Object)</code></a> in order to ensure that this metadata is modifiable.</li> |
| <li>If <code>source</code> is null or empty, returns <code>null</code> |
| (meaning that the metadata property is not provided).</li> |
| <li>If <code>target</code> is null, creates a new <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>List</code></a>.</li> |
| <li>Copies the content of the given <code>source</code> into the target.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the source list, or <code>null</code>.</dd> |
| <dd><code>target</code> - the target list, or <code>null</code> if not yet created.</dd> |
| <dd><code>elementType</code> - the base type of elements to put in the list.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a list (possibly the <code>target</code> instance) containing the <code>source</code> |
| elements, or <code>null</code> if the source was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#nonNullList(java.util.List,java.lang.Class)"><code>nonNullList(List, Class)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="writeSet(java.util.Collection,java.util.Set,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>writeSet</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E> writeSet​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E> target, |
| <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><E> elementType) |
| throws <a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></pre> |
| <div class="block">Writes the content of the <code>source</code> collection into the <code>target</code> set, |
| creating it if needed. This method performs the following steps: |
| |
| <ul> |
| <li>Invokes <a href="#checkWritePermission(java.lang.Object)"><code>checkWritePermission(Object)</code></a> in order to ensure that this metadata is modifiable.</li> |
| <li>If <code>source</code> is null or empty, returns <code>null</code> |
| (meaning that the metadata property is not provided).</li> |
| <li>If <code>target</code> is null, creates a new <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Set</code></a>.</li> |
| <li>Copies the content of the given <code>source</code> into the target.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the source set, or <code>null</code>.</dd> |
| <dd><code>target</code> - the target set, or <code>null</code> if not yet created.</dd> |
| <dd><code>elementType</code> - the base type of elements to put in the set.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a set (possibly the <code>target</code> instance) containing the <code>source</code> elements, |
| or <code>null</code> if the source was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#nonNullSet(java.util.Set,java.lang.Class)"><code>nonNullSet(Set, Class)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="writeCollection(java.util.Collection,java.util.Collection,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>writeCollection</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E> writeCollection​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E> target, |
| <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><E> elementType) |
| throws <a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></pre> |
| <div class="block">Writes the content of the <code>source</code> collection into the <code>target</code> list or set, |
| creating it if needed. This method performs the following steps: |
| |
| <ul> |
| <li>Invokes <a href="#checkWritePermission(java.lang.Object)"><code>checkWritePermission(Object)</code></a> in order to ensure that this metadata is modifiable.</li> |
| <li>If <code>source</code> is null or empty, returns <code>null</code> |
| (meaning that the metadata property is not provided).</li> |
| <li>If <code>target</code> is null, creates a new <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Set</code></a> or a new <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>List</code></a> |
| depending on the value returned by <a href="#collectionType(java.lang.Class)"><code>collectionType(Class)</code></a>.</li> |
| <li>Copies the content of the given <code>source</code> into the target.</li> |
| </ul> |
| |
| <div class="section">Choosing a collection type</div> |
| Implementations shall invoke <a href="#writeList(java.util.Collection,java.util.List,java.lang.Class)"><code>writeList</code></a> or <a href="#writeSet(java.util.Collection,java.util.Set,java.lang.Class)"><code>writeSet</code></a> methods |
| instead than this method when the collection type is enforced by ISO specification. |
| When the type is not enforced by the specification, some freedom are allowed at |
| implementer choice. The default implementation invokes <a href="#collectionType(java.lang.Class)"><code>collectionType(Class)</code></a> |
| in order to get a hint about whether a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>List</code></a> or a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Set</code></a> should be used.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the source collection, or <code>null</code>.</dd> |
| <dd><code>target</code> - the target collection, or <code>null</code> if not yet created.</dd> |
| <dd><code>elementType</code> - the base type of elements to put in the collection.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a collection (possibly the <code>target</code> instance) containing the <code>source</code> elements, |
| or <code>null</code> if the source was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="writeMap(java.util.Map,java.util.Map,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>writeMap</h4> |
| <pre class="methodSignature">protected final <K,​V> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V> writeMap​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><? extends K,​? extends V> source, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V> target, |
| <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><K> keyType) |
| throws <a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></pre> |
| <div class="block">Writes the content of the <code>source</code> map into the <code>target</code> map, |
| creating it if needed. This method performs the following steps: |
| |
| <ul> |
| <li>Invokes <a href="#checkWritePermission(java.lang.Object)"><code>checkWritePermission(Object)</code></a> in order to ensure that this metadata is modifiable.</li> |
| <li>If <code>source</code> is null or empty, returns <code>null</code> |
| (meaning that the metadata property is not provided).</li> |
| <li>If <code>target</code> is null, creates a new <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Map</code></a>.</li> |
| <li>Copies the content of the given <code>source</code> into the target.</li> |
| </ul></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>K</code> - the type of keys represented by the <code>Class</code> argument.</dd> |
| <dd><code>V</code> - the type of values in the map.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the source map, or <code>null</code>.</dd> |
| <dd><code>target</code> - the target map, or <code>null</code> if not yet created.</dd> |
| <dd><code>keyType</code> - the base type of keys to put in the map.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a map (possibly the <code>target</code> instance) containing the <code>source</code> entries, |
| or <code>null</code> if the source was null.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#nonNullMap(java.util.Map,java.lang.Class)"><code>nonNullMap(Map, Class)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="copyList(java.util.Collection,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copyList</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E> copyList​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <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><E> elementType)</pre> |
| <div class="block">Creates a list with the content of the <code>source</code> collection, |
| or returns <code>null</code> if the source is <code>null</code> or empty. |
| This is a convenience method for copying fields in subclass copy constructors.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the source collection, or <code>null</code>.</dd> |
| <dd><code>elementType</code> - the base type of elements to put in the list.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a list containing the <code>source</code> elements, |
| or <code>null</code> if the source was null or empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="copySet(java.util.Collection,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copySet</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E> copySet​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <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><E> elementType)</pre> |
| <div class="block">Creates a set with the content of the <code>source</code> collection, |
| or returns <code>null</code> if the source is <code>null</code> or empty. |
| This is a convenience method for copying fields in subclass copy constructors.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the source collection, or <code>null</code>.</dd> |
| <dd><code>elementType</code> - the base type of elements to put in the set.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a set containing the <code>source</code> elements, |
| or <code>null</code> if the source was null or empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="copyCollection(java.util.Collection,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copyCollection</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E> copyCollection​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><? extends E> source, |
| <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><E> elementType)</pre> |
| <div class="block">Creates a list or set with the content of the <code>source</code> collection, |
| or returns <code>null</code> if the source is <code>null</code> or empty. |
| This is a convenience method for copying fields in subclass copy constructors. |
| |
| <p>The collection type is selected as described in the |
| <a href="#nonNullCollection(java.util.Collection,java.lang.Class)"><code>nonNullCollection(Collection, Class)</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the source collection, or <code>null</code>.</dd> |
| <dd><code>elementType</code> - the base type of elements to put in the collection.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a collection containing the <code>source</code> elements, |
| or <code>null</code> if the source was null or empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="copyMap(java.util.Map,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copyMap</h4> |
| <pre class="methodSignature">protected final <K,​V> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V> copyMap​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><? extends K,​? extends V> source, |
| <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><K> keyType)</pre> |
| <div class="block">Creates a map with the content of the <code>source</code> map, |
| or returns <code>null</code> if the source is <code>null</code> or empty. |
| This is a convenience method for copying fields in subclass copy constructors.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>K</code> - the type of keys represented by the <code>Class</code> argument.</dd> |
| <dd><code>V</code> - the type of values in the map.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>source</code> - the source map, or <code>null</code>.</dd> |
| <dd><code>keyType</code> - the base type of keys to put in the map.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a map containing the <code>source</code> entries, |
| or <code>null</code> if the source was null or empty.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="singleton(java.lang.Object,java.lang.Class)"> |
| <!-- --> |
| </a><a id="singleton(E,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>singleton</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E> singleton​(E 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><E> elementType)</pre> |
| <div class="block">Creates a singleton list or set containing only the given value, if non-null. |
| This is a convenience method for initializing fields in subclass constructors. |
| |
| <p>The collection type is selected as described in the |
| <a href="#nonNullCollection(java.util.Collection,java.lang.Class)"><code>nonNullCollection(Collection, Class)</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - the singleton value to put in the returned collection, or <code>null</code>.</dd> |
| <dd><code>elementType</code> - the element type (used only if <code>value</code> is non-null).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a new modifiable collection containing the given value, |
| or <code>null</code> if the given value was null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="nonNullList(java.util.List,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>nonNullList</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E> nonNullList​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><E> current, |
| <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><E> elementType)</pre> |
| <div class="block">Returns the specified list, or a new one if <code>current</code> is null. |
| This is a convenience method for implementation of <code>getFoo()</code> methods.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>current</code> - the existing list, or <code>null</code> if the list has not yet been created.</dd> |
| <dd><code>elementType</code> - the element type (used only if <code>current</code> is null).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>current</code>, or a new list if <code>current</code> is null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="nonNullSet(java.util.Set,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>nonNullSet</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E> nonNullSet​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E> current, |
| <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><E> elementType)</pre> |
| <div class="block">Returns the specified set, or a new one if <code>current</code> is null. |
| This is a convenience method for implementation of <code>getFoo()</code> methods.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>current</code> - the existing set, or <code>null</code> if the set has not yet been created.</dd> |
| <dd><code>elementType</code> - the element type (used only if <code>current</code> is null).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>current</code>, or a new set if <code>current</code> is null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="nonNullCollection(java.util.Collection,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>nonNullCollection</h4> |
| <pre class="methodSignature">protected final <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E> nonNullCollection​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E> current, |
| <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><E> elementType)</pre> |
| <div class="block">Returns the specified collection, or a new one if <code>current</code> is null. |
| This is a convenience method for implementation of <code>getFoo()</code> methods. |
| |
| <div class="section">Choosing a collection type</div> |
| Implementations shall invoke <a href="#nonNullList(java.util.List,java.lang.Class)"><code>nonNullList(…)</code></a> or <a href="#nonNullSet(java.util.Set,java.lang.Class)"><code>nonNullSet(…)</code></a> |
| instead than this method when the collection type is enforced by ISO specification. |
| When the type is not enforced by the specification, some freedom are allowed at implementer choice. |
| The default implementation invokes <a href="#collectionType(java.lang.Class)"><code>collectionType(Class)</code></a> in order to get a hint about whether |
| a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>List</code></a> or a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Set</code></a> should be used.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>current</code> - the existing collection, or <code>null</code> if the collection has not yet been created.</dd> |
| <dd><code>elementType</code> - the element type (used only if <code>current</code> is null).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>current</code>, or a new collection if <code>current</code> is null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="nonNullMap(java.util.Map,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>nonNullMap</h4> |
| <pre class="methodSignature">protected final <K,​V> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V> nonNullMap​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V> current, |
| <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><K> keyType)</pre> |
| <div class="block">Returns the specified map, or a new one if <code>current</code> is null. |
| This is a convenience method for implementation of <code>getFoo()</code> methods.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>K</code> - the type of keys represented by the <code>Class</code> argument.</dd> |
| <dd><code>V</code> - the type of values in the map.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>current</code> - the existing map, or <code>null</code> if the map has not yet been created.</dd> |
| <dd><code>keyType</code> - the key type (used only if <code>current</code> is null).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>current</code>, or a new map if <code>current</code> is null.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="collectionType(java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>collectionType</h4> |
| <pre class="methodSignature">protected <E> <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><? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><E>> collectionType​(<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><E> elementType)</pre> |
| <div class="block">Returns the type of collection to use for the given type. The current implementation can |
| return only two values: <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a>.class</code> if the property should not |
| accept duplicated values, or <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>.class</code> otherwise. Future SIS |
| versions may accept other types. |
| |
| <p>The default implementation returns <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a>.class</code> if the element type |
| is assignable to <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/util/CodeList.html?is-external=true" title="class or interface in org.opengis.util" class="externalLink"><code>CodeList</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Enum</code></a>, <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"><code>String</code></a>, <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"><code>Charset</code></a>, |
| <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"><code>Locale</code></a> or <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Currency.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Currency</code></a>, and <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>.class</code> otherwise. |
| Subclasses can override this method for choosing different kind of collections. |
| <em>Note however that <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Set</code></a> should be used only with immutable element types</em>, |
| for <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">hash code</a> stability.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type of elements in the collection to be created.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>elementType</code> - the type of elements in the collection to be created.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>List.class</code> or <code>Set.class</code> depending on whether the |
| property shall accept duplicated values or not.</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/ModifiableMetadata.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><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </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>Field | </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> |