added var.html

This commit is contained in:
Bulgakov Alexander committed 2016-10-31 23:52:20 +03:00
1 parent 62672c0385
commit 4fbbd8ed03
5 files changed
+130

No files matched your search

+3
View File
@@ -154,6 +154,9 @@ such as converting the changelog into HTML, and creating javadoc.
<antcall target="-integrateSnippet">
<param name="transformationName" value="Singular-snippet" />
</antcall>
<antcall target="-integrateSnippet">
<param name="transformationName" value="experimental/var" />
</antcall>
<antcall target="-integrateSnippet">
<param name="transformationName" value="experimental/Delegate" />
</antcall>
@@ -0,0 +1,21 @@
import java.util.ArrayList;
import lombok.var;
public class ValExample {
public String example() {
ArrayList example = new ArrayList<String>();
example.add("Hello, World!");
final String foo = example.get(0);
return foo.toLowerCase();
}
public void example2() {
ArrayList list = new ArrayList<String>();
list.add("zero");
list.add("one");
list.add("two");
for(int i = 0; i < list.size(); ++i) {
System.out.printf("%d: %s\n", i, list.get(i));
}
}
}
@@ -0,0 +1,21 @@
import java.util.ArrayList;
import lombok.var;
public class ValExample {
public String example() {
var example = new ArrayList<String>();
example.add("Hello, World!");
final var foo = example.get(0);
return foo.toLowerCase();
}
public void example2() {
var list = new ArrayList<String>();
list.add("zero");
list.add("one");
list.add("two");
for(var i = 0; i < list.size(); ++i) {
System.out.printf("%d: %s\n", i, list.get(i));
}
}
}
+2
View File
@@ -22,6 +22,8 @@
Features that receive positive community feedback and which seem to produce clean, flexible code will eventually become accepted
as a core feature and move out of the experimental package.
<dl>
<dt><a href="var.html"><code>@var</code></a></dt>
<dd>The same as @val but modifiable.</dd>
<dt><a href="Accessors.html"><code>@Accessors</code></a></dt>
<dd>A more fluent API for getters and setters.</dd>
<dt><a href="ExtensionMethod.html"><code>@ExtensionMethod</code></a></dt>
+83
View File
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../../logi/reset.css" />
<link rel="stylesheet" type="text/css" href="../features.css" />
<link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" />
<meta name="description" content="Spice up your java" />
<title>EXPERIMENTAL – @var</title>
</head><body><div id="pepper">
<div class="minimumHeight"></div>
<div class="meat">
<div class="header"><a href="../../index.html">Project Lombok</a></div>
<h1>@var</h1>
<div class="byline">Modifiable local variables with a type inferred by assigning value.</div>
<div class="since">
<h3>Since</h3>
<p>
@var was introduced as experimental feature in lombok v1.16.11.
</p>
</div>
<div class="experimental">
<h3>Experimental</h3>
<p>
Experimental because:
<ul>
<li>This feature is very controversial.</li>
<li>There is <a href="http://openjdk.java.net/jeps/286">JEP 286</a> that should make the @var obsolete.</li>
</ul>Current status: <em>uncertain</em> - Currently we feel this feature cannot move out of experimental status.
</div>
<div class="overview">
<h3>Overview</h3>
<p>
The <code>@var</code> has the same mission as the <a href="../val.html">@val</a> annotation but modifable.
</p>
</div>
<div class="snippets">
<div class="pre">
<h3>With Lombok</h3>
<div class="snippet">@HTML_PRE@</div>
</div>
<div class="sep"></div>
<div class="post">
<h3>Vanilla Java</h3>
<div class="snippet">@HTML_POST@</div>
</div>
</div>
<div style="clear: left;"></div>
<div class="overview confKeys">
<h3>Supported configuration keys:</h3>
<dl>
<dt><code>lombok.val.flagUsage</code> = [<code>allow</code>] (default: not set)</dt>
<dd>Lombok will flag any usage of <code>var</code> as a error if not configured.</dd>
</dl>
</div>
<div class="overview">
<h3>Small print</h3><div class="smallprint">
<p>
For compound types, the most common superclass is inferred, not any shared interfaces. For example, <code>bool ? new HashSet() : new ArrayList()</code>
is an expression with a compound type: The result is both <code>AbstractCollection</code> as well as <code>Serializable</code>. The type inferred will be
<code>AbstractCollection</code>, as that is a class, whereas <code>Serializable</code> is an interface.
</p><p>
In ambiguous cases, such as when the initializer expression is <code>null</code>, <code>java.lang.Object</code> is inferred.
</p>
</div>
</div>
<div class="footer">
<a href="index.html">Back to experimental features</a> | <span class="disabled">Previous feature</span> | <a href="ExtensionMethod.html">Next feature (@ExtensionMethod)</a><br />
<a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright &copy; 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span>
</div>
<div style="clear: both;"></div>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-9884254-1");
pageTracker._trackPageview();
} catch(err) {}
</script>
</body></html>