| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (19) --> |
| <title>ModifiableMetadata (Apache SIS 1.3 API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: org.apache.sis.metadata, class: ModifiableMetadata"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="org.apache.sis.metadata.ModifiableMetadata class"> |
| <meta name="keywords" content="state()"> |
| <meta name="keywords" content="transitionTo()"> |
| <meta name="keywords" content="deepCopy()"> |
| <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="../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-3.6.0.min.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var pathtoroot = "../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">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#class">Help</a></li> |
| </ul> |
| <ul class="sub-nav-list-small"> |
| <li> |
| <p>Summary:</p> |
| <ul> |
| <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> |
| </li> |
| <li> |
| <p>Detail:</p> |
| <ul> |
| <li>Field</li> |
| <li><a href="#constructor-detail">Constr</a></li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div id="navbar-sub-list"> |
| <ul class="sub-nav-list"> |
| <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="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><a href="../../../../search.html">SEARCH</a> |
| <input type="text" id="search-input" disabled placeholder="Search"> |
| <input type="reset" id="reset-button" disabled value="reset"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.sis.metadata</a></div> |
| <h1 title="Class ModifiableMetadata" class="title">Class ModifiableMetadata</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| <div class="inheritance"><a href="AbstractMetadata.html" title="class in org.apache.sis.metadata">AbstractMetadata</a> |
| <div class="inheritance">ModifiableMetadata</div> |
| </div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <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 class="notes"> |
| <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> |
| <div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">ModifiableMetadata</span> |
| <span class="extends-implements">extends <a href="AbstractMetadata.html" title="class in org.apache.sis.metadata">AbstractMetadata</a></span></div> |
| <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. |
| |
| <h2>Tip for subclass implementations</h2> |
| 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/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">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 class="notes"> |
| <dt>Since:</dt> |
| <dd>0.3</dd> |
| |
| <p><font size="-1">Defined in the <code>sis-metadata</code> module</font></p> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <li> |
| <section class="nested-class-summary" id="nested-class-summary"> |
| <h2>Nested Class Summary</h2> |
| <div class="caption"><span>Nested Classes</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Class</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>static enum </code></div> |
| <div class="col-second even-row-color"><code><a href="ModifiableMetadata.State.html" class="type-name-link" title="enum class in org.apache.sis.metadata">ModifiableMetadata.State</a></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Whether the metadata is still editable or has been made final.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor-summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier</div> |
| <div class="table-header col-second">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>protected </code></div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">ModifiableMetadata</a>()</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Constructs an initially empty metadata.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#checkWritePermission(java.lang.Object)" class="member-name-link">checkWritePermission</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> current)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Checks if changes in the metadata are allowed.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><? extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E>></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#collectionType(java.lang.Class)" class="member-name-link">collectionType</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the type of collection to use for the given type.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#copyCollection(java.util.Collection,java.lang.Class)" class="member-name-link">copyCollection</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <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> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#copyList(java.util.Collection,java.lang.Class)" class="member-name-link">copyList</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <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> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <K,<wbr> |
| V> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#copyMap(java.util.Map,java.lang.Class)" class="member-name-link">copyMap</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><? extends K,<wbr>? extends V> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><K> keyType)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <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> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#copySet(java.util.Collection,java.lang.Class)" class="member-name-link">copySet</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <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> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="ModifiableMetadata.html" title="class in org.apache.sis.metadata">ModifiableMetadata</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#deepCopy(org.apache.sis.metadata.ModifiableMetadata.State)" class="member-name-link">deepCopy</a><wbr>(<a href="ModifiableMetadata.State.html" title="enum class in org.apache.sis.metadata">ModifiableMetadata.State</a> target)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Copies (if necessary) this metadata and all its children.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#nonNullCollection(java.util.Collection,java.lang.Class)" class="member-name-link">nonNullCollection</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E> current, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the specified collection, or a new one if <code>current</code> is null.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#nonNullList(java.util.List,java.lang.Class)" class="member-name-link">nonNullList</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E> current, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the specified list, or a new one if <code>current</code> is null.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <K,<wbr> |
| V> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#nonNullMap(java.util.Map,java.lang.Class)" class="member-name-link">nonNullMap</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V> current, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><K> keyType)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the specified map, or a new one if <code>current</code> is null.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#nonNullSet(java.util.Set,java.lang.Class)" class="member-name-link">nonNullSet</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E> current, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the specified set, or a new one if <code>current</code> is null.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#singleton(E,java.lang.Class)" class="member-name-link">singleton</a><wbr>(E value, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Creates a singleton list or set containing only the given value, if non-null.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="ModifiableMetadata.State.html" title="enum class in org.apache.sis.metadata">ModifiableMetadata.State</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#state()" class="member-name-link">state</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Tells whether this instance of metadata is editable.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#transitionTo(org.apache.sis.metadata.ModifiableMetadata.State)" class="member-name-link">transitionTo</a><wbr>(<a href="ModifiableMetadata.State.html" title="enum class in org.apache.sis.metadata">ModifiableMetadata.State</a> target)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Requests this metadata instance and (potentially) all its children to transition to a new state.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#writeCollection(java.util.Collection,java.util.Collection,java.lang.Class)" class="member-name-link">writeCollection</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E> target, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <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> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#writeList(java.util.Collection,java.util.List,java.lang.Class)" class="member-name-link">writeList</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E> target, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Writes the content of the <code>source</code> collection into the <code>target</code> list, |
| creating it if needed.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <K,<wbr> |
| V> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#writeMap(java.util.Map,java.util.Map,java.lang.Class)" class="member-name-link">writeMap</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><? extends K,<wbr>? extends V> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V> target, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><K> keyType)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Writes the content of the <code>source</code> map into the <code>target</code> map, |
| creating it if needed.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected final <E> <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#writeSet(java.util.Collection,java.util.Set,java.lang.Class)" class="member-name-link">writeSet</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E> target, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Writes the content of the <code>source</code> collection into the <code>target</code> set, |
| creating it if needed.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-AbstractMetadata">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></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-Object">Methods inherited from class <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor-detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>()"> |
| <h3>ModifiableMetadata</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="element-name">ModifiableMetadata</span>()</div> |
| <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> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="state()"> |
| <h3>state</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="ModifiableMetadata.State.html" title="enum class in org.apache.sis.metadata">ModifiableMetadata.State</a></span> <span class="element-name">state</span>()</div> |
| <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 class="notes"> |
| <dt>Returns:</dt> |
| <dd>the state (editable, completable or final) of this <code>ModifiableMetadata</code> instance.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="transitionTo(org.apache.sis.metadata.ModifiableMetadata.State)"> |
| <h3>transitionTo</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">transitionTo</span><wbr><span class="parameters">(<a href="ModifiableMetadata.State.html" title="enum class in org.apache.sis.metadata">ModifiableMetadata.State</a> target)</span></div> |
| <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 class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>target</code> - the desired new state (editable, completable or final).</dd> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if the state of this <code>ModifiableMetadata</code> changed as a result of this method call.</dd> |
| <dt>Throws:</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>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="deepCopy(org.apache.sis.metadata.ModifiableMetadata.State)"> |
| <h3>deepCopy</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="ModifiableMetadata.html" title="class in org.apache.sis.metadata">ModifiableMetadata</a></span> <span class="element-name">deepCopy</span><wbr><span class="parameters">(<a href="ModifiableMetadata.State.html" title="enum class in org.apache.sis.metadata">ModifiableMetadata.State</a> target)</span></div> |
| <div class="block">Copies (if necessary) this metadata and all its children. |
| Changes in the returned metadata will not affect this <code>ModifiableMetadata</code> instance, and conversely. |
| The returned metadata will be in the <a href="#state()">state</a> specified by the <code>target</code> argument. |
| The state of this <code>ModifiableMetadata</code> instance stay unchanged. |
| |
| <p>As a special case, this method returns <code>this</code> if and only if the specified target is <a href="ModifiableMetadata.State.html#FINAL"><code>ModifiableMetadata.State.FINAL</code></a> |
| and this <code>ModifiableMetadata</code> instance is already in final state. In that particular case, copies are not |
| needed for protecting metadata against changes because neither <code>this</code> or the returned value can be modified.</p> |
| |
| <p>This method is typically invoked for getting a modifiable metadata from an unmodifiable one:</p> |
| |
| <blockquote><pre>Metadata source = ...; <i><font color="gray">// Any implementation.</font></i> |
| DefaultMetadata md = DefaultMetadata.<b>castOrCopy</b>(source); |
| md = (DefaultMetadata) md.<b>deepCopy</b>(DefaultMetadata.State.EDITABLE);</pre></blockquote> |
| |
| <h4>Alternative</h4> |
| If unconditional copy is desired, or if the metadata to copy may be arbitrary implementations |
| of GeoAPI interfaces (i.e. not necessarily a <code>ModifiableMetadata</code> subclass), |
| then the following code can be used instead: |
| |
| <blockquote><pre>MetadataCopier copier = <font color="green">new</font> <b>MetadataCopier</b>(MetadataStandard.ISO_19115); |
| Metadata source = ...; <i><font color="gray">// Any implementation.</font></i> |
| Metadata copy = copier.<b>copy</b>(Metadata.<font color="green">class</font>, source);</pre></blockquote> |
| |
| The <code>Metadata</code> type in above example can be replaced by any other ISO 19115 type. |
| Types from other standards can also be used if the <a href="MetadataStandard.html#ISO_19115"><code>MetadataStandard.ISO_19115</code></a> constant |
| is replaced accordingly.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>target</code> - the desired state (editable, completable or final).</dd> |
| <dt>Returns:</dt> |
| <dd>a copy (except in above-cited special case) of this metadata in the specified state.</dd> |
| <dt>Since:</dt> |
| <dd>1.1</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="MetadataCopier.html" title="class in org.apache.sis.metadata"><code>MetadataCopier</code></a></li> |
| <li><a href="iso/DefaultMetadata.html#deepCopy(org.opengis.metadata.Metadata)"><code>DefaultMetadata.deepCopy(Metadata)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="checkWritePermission(java.lang.Object)"> |
| <h3>checkWritePermission</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">checkWritePermission</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> current)</span> |
| throws <span class="exceptions"><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></span></div> |
| <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 class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>current</code> - the current value, or <code>null</code> if none.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#state()"><code>state()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="writeList(java.util.Collection,java.util.List,java.lang.Class)"> |
| <h3>writeList</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E></span> <span class="element-name">writeList</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E> target, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span> |
| throws <span class="exceptions"><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></span></div> |
| <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/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link"><code>List</code></a>.</li> |
| <li>Copies the content of the given <code>source</code> into the target.</li> |
| </ul></div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</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>Throws:</dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#nonNullList(java.util.List,java.lang.Class)"><code>nonNullList(List, Class)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="writeSet(java.util.Collection,java.util.Set,java.lang.Class)"> |
| <h3>writeSet</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E></span> <span class="element-name">writeSet</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E> target, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span> |
| throws <span class="exceptions"><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></span></div> |
| <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/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link"><code>Set</code></a>.</li> |
| <li>Copies the content of the given <code>source</code> into the target.</li> |
| </ul></div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</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>Throws:</dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#nonNullSet(java.util.Set,java.lang.Class)"><code>nonNullSet(Set, Class)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="writeCollection(java.util.Collection,java.util.Collection,java.lang.Class)"> |
| <h3>writeCollection</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E></span> <span class="element-name">writeCollection</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E> target, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span> |
| throws <span class="exceptions"><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></span></div> |
| <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/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link"><code>Set</code></a> or a new <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link"><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> |
| |
| <h4>Choosing a collection type</h4> |
| 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 of 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/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link"><code>List</code></a> or a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link"><code>Set</code></a> should be used.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</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>Throws:</dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="writeMap(java.util.Map,java.util.Map,java.lang.Class)"> |
| <h3>writeMap</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><K,<wbr> |
| V></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V></span> <span class="element-name">writeMap</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><? extends K,<wbr>? extends V> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V> target, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><K> keyType)</span> |
| throws <span class="exceptions"><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></span></div> |
| <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/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link"><code>Map</code></a>.</li> |
| <li>Copies the content of the given <code>source</code> into the target.</li> |
| </ul></div> |
| <dl class="notes"> |
| <dt>Type Parameters:</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>Parameters:</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>Returns:</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>Throws:</dt> |
| <dd><code><a href="UnmodifiableMetadataException.html" title="class in org.apache.sis.metadata">UnmodifiableMetadataException</a></code> - if this metadata is unmodifiable.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#nonNullMap(java.util.Map,java.lang.Class)"><code>nonNullMap(Map, Class)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="copyList(java.util.Collection,java.lang.Class)"> |
| <h3>copyList</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E></span> <span class="element-name">copyList</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span></div> |
| <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 class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</dt> |
| <dd>a list containing the <code>source</code> elements, |
| or <code>null</code> if the source was null or empty.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="copySet(java.util.Collection,java.lang.Class)"> |
| <h3>copySet</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E></span> <span class="element-name">copySet</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span></div> |
| <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 class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</dt> |
| <dd>a set containing the <code>source</code> elements, |
| or <code>null</code> if the source was null or empty.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="copyCollection(java.util.Collection,java.lang.Class)"> |
| <h3>copyCollection</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E></span> <span class="element-name">copyCollection</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><? extends E> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span></div> |
| <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 class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</dt> |
| <dd>a collection containing the <code>source</code> elements, |
| or <code>null</code> if the source was null or empty.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="copyMap(java.util.Map,java.lang.Class)"> |
| <h3>copyMap</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><K,<wbr> |
| V></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V></span> <span class="element-name">copyMap</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><? extends K,<wbr>? extends V> source, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><K> keyType)</span></div> |
| <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 class="notes"> |
| <dt>Type Parameters:</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>Parameters:</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>Returns:</dt> |
| <dd>a map containing the <code>source</code> entries, |
| or <code>null</code> if the source was null or empty.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="singleton(E,java.lang.Class)"> |
| <h3 id="singleton(java.lang.Object,java.lang.Class)">singleton</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E></span> <span class="element-name">singleton</span><wbr><span class="parameters">(E value, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span></div> |
| <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 class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</dt> |
| <dd>a new modifiable collection containing the given value, |
| or <code>null</code> if the given value was null.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="nonNullList(java.util.List,java.lang.Class)"> |
| <h3>nonNullList</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E></span> <span class="element-name">nonNullList</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><E> current, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span></div> |
| <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 class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</dt> |
| <dd><code>current</code>, or a new list if <code>current</code> is null.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="nonNullSet(java.util.Set,java.lang.Class)"> |
| <h3>nonNullSet</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E></span> <span class="element-name">nonNullSet</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><E> current, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span></div> |
| <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 class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</dt> |
| <dd><code>current</code>, or a new set if <code>current</code> is null.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="nonNullCollection(java.util.Collection,java.lang.Class)"> |
| <h3>nonNullCollection</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E></span> <span class="element-name">nonNullCollection</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E> current, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span></div> |
| <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. |
| |
| <h4>Choosing a collection type</h4> |
| 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 of 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/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link"><code>List</code></a> or a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link"><code>Set</code></a> should be used.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type represented by the <code>Class</code> argument.</dd> |
| <dt>Parameters:</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>Returns:</dt> |
| <dd><code>current</code>, or a new collection if <code>current</code> is null.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="nonNullMap(java.util.Map,java.lang.Class)"> |
| <h3>nonNullMap</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="type-parameters"><K,<wbr> |
| V></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V></span> <span class="element-name">nonNullMap</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><K,<wbr>V> current, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><K> keyType)</span></div> |
| <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 class="notes"> |
| <dt>Type Parameters:</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>Parameters:</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>Returns:</dt> |
| <dd><code>current</code>, or a new map if <code>current</code> is null.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="collectionType(java.lang.Class)"> |
| <h3>collectionType</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="type-parameters"><E></span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><? extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><E>></span> <span class="element-name">collectionType</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><E> elementType)</span></div> |
| <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/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a>.class</code> if the property should not |
| accept duplicated values, or <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>.class</code> otherwise. Future SIS |
| versions may accept other types. |
| |
| <p>The default implementation returns <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a>.class</code> if the element type |
| is assignable to <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/CodeList.html" title="class or interface in org.opengis.util" class="external-link"><code>CodeList</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link"><code>Enum</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link"><code>String</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link"><code>Charset</code></a>, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Locale.html" title="class or interface in java.util" class="external-link"><code>Locale</code></a> or <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Currency.html" title="class or interface in java.util" class="external-link"><code>Currency</code></a>, and <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">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/en/java/javase/16/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link"><code>Set</code></a> should be used only with immutable element types</em>, |
| for <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash code</a> stability.</p></div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>E</code> - the type of elements in the collection to be created.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>elementType</code> - the type of elements in the collection to be created.</dd> |
| <dt>Returns:</dt> |
| <dd><code>List.class</code> or <code>Set.class</code> depending on whether the |
| property shall accept duplicated values or not.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 2010–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |