mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-30551 add package.html
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
<p>Please consider to use annotation parameters only to achieve backward compatibility. Otherwise feel free to file issues about serialization cosmetics.</p>
|
||||
<h2>Lists and Sets</h2>
|
||||
<p><code>XCollection</code> annotation intended to customize list and set serialization.</p>
|
||||
<p>Two styles are provided:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>v1</code>:</p>
|
||||
<pre><span style="color: #000000; "><</span><span style="color: #000080; font-weight: bold; ">option </span><span style="color: #0000ff; font-weight: bold; ">name=</span><span style="color: #008000; font-weight: bold; ">"propertyName"</span><span style="color: #000000; ">></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">option </span><span style="color: #0000ff; font-weight: bold; ">value=</span><span style="color: #008000; font-weight: bold; ">"value1" </span><span style="color: #000000; ">/></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">option </span><span style="color: #0000ff; font-weight: bold; ">value=</span><span style="color: #008000; font-weight: bold; ">"valueN" </span><span style="color: #000000; ">/></span>
|
||||
</<span style="color: #000080; font-weight: bold; ">option</span><span style="color: #000000; ">></span>
|
||||
</pre>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>v2</code>:</p>
|
||||
<pre><span style="color: #000000; "><</span><span style="color: #000080; font-weight: bold; ">propertyName</span><span style="color: #000000; ">></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">option </span><span style="color: #0000ff; font-weight: bold; ">value=</span><span style="color: #008000; font-weight: bold; ">"$value" </span><span style="color: #000000; ">/></span>
|
||||
</<span style="color: #000080; font-weight: bold; ">propertyName</span><span style="color: #000000; ">></span>
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Where second-level <code>option</code> it is item element (use <code>elementName</code> to customize element name) and
|
||||
<code>value</code> it is value attribute (use <code>valueAttributeName</code> to customize attribute name).</p>
|
||||
<p>Because of backward compatibility, <code>v1</code> style is used by default. In the examples <code>v2</code> style is used.</p>
|
||||
<h3>Custom List Item Value Attribute Name</h3>
|
||||
<p>Value of primitive type wrapped into element named <code>option</code>. <code>valueAttributeName</code> allows you to customize name of value attribute.</p>
|
||||
<p>Empty name is allowed — in this case value will be serialized as element text.</p>
|
||||
<ul>
|
||||
<li><code>valueAttributeName = "name"</code>
|
||||
<pre><span style="color: #000000; "><</span><span style="color: #000080; font-weight: bold; ">propertyName</span><span style="color: #000000; ">></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">option </span><span style="color: #0000ff; font-weight: bold; ">name=</span><span style="color: #008000; font-weight: bold; ">"$value1" </span><span style="color: #000000; ">/></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">option </span><span style="color: #0000ff; font-weight: bold; ">name=</span><span style="color: #008000; font-weight: bold; ">"$valueN" </span><span style="color: #000000; ">/> </span>
|
||||
</<span style="color: #000080; font-weight: bold; ">propertyName</span><span style="color: #000000; ">></span>
|
||||
</pre>
|
||||
</li>
|
||||
<li><code>valueAttributeName = ""</code>
|
||||
<pre><span style="color: #000000; "><</span><span style="color: #000080; font-weight: bold; ">propertyName</span><span style="color: #000000; ">></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">option</span><span style="color: #000000; ">></span><span style="color: #000000; ">$value1</span><span style="color: #000000; "></</span><span style="color: #000080; font-weight: bold; ">option</span><span style="color: #000000; ">></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">option</span><span style="color: #000000; ">></span><span style="color: #000000; ">$valueN</span><span style="color: #000000; "></</span><span style="color: #000080; font-weight: bold; ">option</span><span style="color: #000000; ">></span>
|
||||
</<span style="color: #000080; font-weight: bold; ">propertyName</span><span style="color: #000000; ">></span>
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Maps</h2>
|
||||
<p><code>XMap</code> annotation intended to customize map serialization and to enable new serialization format.</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>With <code>XMap</code> annotation:</p>
|
||||
<pre><span style="color: #000000; "><</span><span style="color: #000080; font-weight: bold; ">propertyName</span><span style="color: #000000; ">></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">entry </span><span style="color: #0000ff; font-weight: bold; ">key=</span><span style="color: #008000; font-weight: bold; ">"key1" </span><span style="color: #0000ff; font-weight: bold; ">value=</span><span style="color: #008000; font-weight: bold; ">"value1" </span><span style="color: #000000; ">/></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">entry </span><span style="color: #0000ff; font-weight: bold; ">key=</span><span style="color: #008000; font-weight: bold; ">"keyN" </span><span style="color: #0000ff; font-weight: bold; ">value=</span><span style="color: #008000; font-weight: bold; ">"valueN" </span><span style="color: #000000; ">/></span>
|
||||
</<span style="color: #000080; font-weight: bold; ">propertyName</span><span style="color: #000000; ">></span>
|
||||
</pre>
|
||||
</li>
|
||||
<li>
|
||||
<p>Without <code>XMap</code> annotation:</p>
|
||||
<pre><span style="color: #000000; "><</span><span style="color: #000080; font-weight: bold; ">option </span><span style="color: #0000ff; font-weight: bold; ">name=</span><span style="color: #008000; font-weight: bold; ">"propertyName"</span><span style="color: #000000; ">></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">map</span><span style="color: #000000; ">></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">entry </span><span style="color: #0000ff; font-weight: bold; ">key=</span><span style="color: #008000; font-weight: bold; ">"key1" </span><span style="color: #0000ff; font-weight: bold; ">value=</span><span style="color: #008000; font-weight: bold; ">"value1" </span><span style="color: #000000; ">/></span>
|
||||
<<span style="color: #000080; font-weight: bold; ">entry </span><span style="color: #0000ff; font-weight: bold; ">key=</span><span style="color: #008000; font-weight: bold; ">"keyN" </span><span style="color: #0000ff; font-weight: bold; ">value=</span><span style="color: #008000; font-weight: bold; ">"valueN" </span><span style="color: #000000; ">/></span>
|
||||
</<span style="color: #000080; font-weight: bold; ">map</span><span style="color: #000000; ">></span>
|
||||
</<span style="color: #000080; font-weight: bold; ">option</span><span style="color: #000000; ">></span>
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<p>So, it is recommended to always specify <code>XMap</code> annotation.</p>
|
||||
Reference in New Issue
Block a user