summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Beust <cedric@beust.com>2017-03-26 06:48:01 -0700
committerCedric Beust <cedric@beust.com>2017-03-26 06:48:01 -0700
commit281eb8c37d5ce2688fe57c3e7dcf3eaa09fb68d8 (patch)
treeda97b7694180a38373971735eb863907136c6ffd
parentb28b7b4174f6f0459530ce07cb81802d9b599a66 (diff)
downloadjcommander-281eb8c37d5ce2688fe57c3e7dcf3eaa09fb68d8.tar.gz
Update doc.
-rw-r--r--doc/index.html19
1 files changed, 14 insertions, 5 deletions
diff --git a/doc/index.html b/doc/index.html
index 8f1dfdc..28ebf39 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -1332,11 +1332,20 @@ private Integer age;</code></pre>
<div class="paragraph">
<p>Attempting to pass a negative integer to this option will cause a ParameterException to be thrown.</p>
</div>
+<div class="paragraph">
+<p>Multiple validators may be specified:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="prettyprint highlight"><code class="language-java" data-lang="java">@Parameter(names = "-count", validateWith = { PositiveInteger.class, CustomOddNumberValidator.class })
+private Integer value;</code></pre>
+</div>
+</div>
</div>
<div class="sect2">
<h3 id="_global_parameter_validation">4.2. Global parameter validation</h3>
<div class="paragraph">
-<p>After parsing your parameters with JCommander, you might want to perform additional validation across these parameters, such as making sure that two mutually exclusive parameters are not both specified. Because of all the potential combinations involved in such validation, JCommander does not provide any annotation-based solution to perform this validation because such an approach would necessarily be very limited by the very nature of Java annotations. Instead, you should simple perform this validation in Java on all the arguments that JCommander just parsed.</p>
+<p>After parsing your parameters with JCommander, you might want to perform additional validation across these parameters, such as making sure that two mutually exclusive parameters are not both specified. Because of all the potential combinations involved in such validation, JCommander does not provide any annotation-based solution to perform this validation because such an approach would necessarily be very limited by the very nature of Java annotations. Instead, you should simply perform this validation in Java on all the arguments that JCommander just parsed.</p>
</div>
</div>
</div>
@@ -1876,12 +1885,12 @@ class MainParams {
</div>
</div>
<div class="paragraph">
-<p>The example above specifies a delegate parameter Delegate which is then referenced in MainParams. You only need to add a <code>MainParams</code> object to your</p>
+<p>The example above specifies a delegate parameter Delegate which is then referenced in MainParams. You only need to add a <code>MainParams</code> object to your
+JCommander configuration in order to use the delegate:</p>
</div>
<div class="listingblock">
<div class="content">
-<pre class="prettyprint highlight"><code class="language-java" data-lang="java">JCommander configuration in order to use the delegate:
-MainParams p = new MainParams();
+<pre class="prettyprint highlight"><code class="language-java" data-lang="java">MainParams p = new MainParams();
new JCommander(p).parse("-v", "-port", "1234");
Assert.assertTrue(p.isVerbose);
Assert.assertEquals(p.delegate.port, 1234);</code></pre>
@@ -2034,7 +2043,7 @@ new Args().with {
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2017-02-12 13:03:46 Pacific Standard Time
+Last updated 2017-03-26 06:45:54 Pacific Daylight Time
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css">