commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jke...@apache.org
Subject svn commit: r267415 - in /jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation: DateValidator.java EnumValidator.java
Date Sat, 03 Sep 2005 01:44:21 GMT
Author: jkeyes
Date: Fri Sep  2 18:44:13 2005
New Revision: 267415

URL: http://svn.apache.org/viewcvs?rev=267415&view=rev
Log:
- updated javadoc

Modified:
    jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/DateValidator.java
    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/DateValidator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/DateValidator.java?rev=267415&r1=267414&r2=267415&view=diff
==============================================================================
--- jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/DateValidator.java
(original)
+++ jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/validation/DateValidator.java
Fri Sep  2 18:44:13 2005
@@ -1,5 +1,5 @@
-/**
- * Copyright 2003-2004 The Apache Software Foundation
+/*
+ * Copyright 2003-2005 The Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,8 +22,36 @@
 import java.util.ListIterator;
 
 /**
- * @author John Keyes
+ * A Validator for date and time value(s).
+ *
+ * The following example shows how to validate that
+ * an argument value(s) is a Date of the following 
+ * type: d/M/yy (see {@link java.text.DateFormat}).
+ *
+ * <pre>
+ * DateFormat date = new SimpleDateFormat("d/M/yy");
+ * ...
+ * ArgumentBuilder builder = new ArgumentBuilder();
+ * Argument dateFormat = 
+ *     builder.withName("date");
+ *            .withValidator(new DateValidator(dateFormat));
+ * </pre>
+ *
+ * The following example shows how to validate that
+ * an argument value(s) is a time of the following 
+ * type: HH:mm:ss (see {@link java.text.DateFormat}).
+ *
+ * <pre>
+ * DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
+ * ...
+ * ArgumentBuilder builder = new ArgumentBuilder();
+ * Argument time = 
+ *     builder.withName("time");
+ *            .withValidator(new DateValidator(timeFormat));
+ * </pre>
  * 
+ * @author John Keyes
+ *
  * @see java.text.DateFormat
  */
 public class DateValidator implements Validator {

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=267415&r1=267414&r2=267415&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
Fri Sep  2 18:44:13 2005
@@ -99,6 +99,8 @@
     }
 
     /**
+     * Returns the Set of valid argument values.
+     *
      * @return Returns the Set of valid argument values.
      */
     public Set getValidValues() {
@@ -106,6 +108,8 @@
     }
 
     /**
+     * Specifies the Set of valid argument values.
+     *
      * @param validValues The Set of valid argument values.
      */
     public void setValidValues(Set 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