commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jke...@apache.org
Subject svn commit: r265798 - /jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/EnumValidator.java
Date Thu, 01 Sep 2005 22:55:36 GMT
Author: jkeyes
Date: Thu Sep  1 15:55:25 2005
New Revision: 265798

URL: http://svn.apache.org/viewcvs?rev=265798&view=rev
Log:
updated javadoc, added example to class doc

Modified:
    jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/EnumValidator.java

Modified: jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/EnumValidator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/EnumValidator.java?rev=265798&r1=265797&r2=265798&view=diff
==============================================================================
--- jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/EnumValidator.java
(original)
+++ jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/EnumValidator.java
Thu Sep  1 15:55:25 2005
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright 2003-2004 The Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,6 +21,21 @@
 
 /**
  * A Validator for a list of known string values.
+ *
+ * The following example shows how to limit the valid values
+ * for the color argument to 'red', 'green', or 'blue'.
+ *
+ * <pre>
+ * Set values = new HashSet();
+ * values.add("red");
+ * values.add("green");
+ * values.add("blue");
+ * ...
+ * ArgumentBuilder builder = new ArgumentBuilder();
+ * Argument color = 
+ *     builder.withName("color");
+ *            .withValidator(new EnumValidator(values));
+ * </pre>
  * 
  * @author John Keyes
  */
@@ -30,10 +45,9 @@
     private Set validValues;
 
     /**
-     * Creates a new StringValidator for the specified values.
+     * Creates a new EnumValidator for the specified values.
      * 
-     * @param values
-     *            the list of permitted values
+     * @param values The list of permitted values
      */
     public EnumValidator(final Set values) {
         this.validValues = values;
@@ -59,7 +73,7 @@
     }
 
     /**
-     * Returns the permitted values in a String
+     * Returns the permitted values in a comma separated String
      * 
      * @return String formatted list of values
      */
@@ -85,14 +99,14 @@
     }
 
     /**
-     * @return Returns the validValues.
+     * @return Returns the Set of valid argument values.
      */
     public Set getValidValues() {
         return validValues;
     }
 
     /**
-     * @param validValues The validValues to set.
+     * @param validValues The Set of valid argument values.
      */
     public void setValidValues(Set validValues) {
         this.validValues = validValues;



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message