You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jk...@apache.org on 2003/05/23 01:11:36 UTC

cvs commit: jakarta-commons/cli/src/java/org/apache/commons/cli Argument.java

jkeyes      2003/05/22 16:11:36

  Modified:    cli/src/java/org/apache/commons/cli Tag: cli_1_x
                        Argument.java
  Log:
  - added License
- added javadoc

CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +109 -0    jakarta-commons/cli/src/java/org/apache/commons/cli/Attic/Argument.java
  
  Index: Argument.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/Attic/Argument.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Argument.java	19 May 2003 20:57:51 -0000	1.1.2.1
  +++ Argument.java	22 May 2003 23:11:35 -0000	1.1.2.2
  @@ -1,10 +1,119 @@
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + *
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowlegement may appear in the software itself,
  + *    if and wherever such third-party acknowlegements normally appear.
  + *
  + * 4. The names "The Jakarta Project", "Commons", and "Apache Software
  + *    Foundation" must not be used to endorse or promote products derived
  + *    from this software without prior written permission. For written
  + *    permission, please contact apache@apache.org.
  + *
  + * 5. Products derived from this software may not be called "Apache"
  + *    nor may "Apache" appear in their names without prior written
  + *    permission of the Apache Group.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>;.
  + *
  + */
   package org.apache.commons.cli;
   
  +/**
  + * An Argument is a command line Option that also has an associated
  + * value or values.
  + * 
  + * @author John Keyes
  + * @since 2.0
  + */
   public interface Argument extends Option {
   
  +	/**
  +	 * Returns the Class type of the argument value(s) 
  +	 * For example, Integer.class
  +	 * 
  +	 * @return
  +	 *     the Class type
  +	 */
       public Class getValueType();
  +    
  +    /**
  +     * Returns the value separator of the argument values.
  +     * For example, if the value is 'a,b,c' and the value separator
  +     * is ',' then there are three values 'a', 'b' and 'c'.
  +     * 
  +     * @return
  +     *     the character that is used as the value separator
  +     */
       public char getValueSeparator();
  +    
  +    /**
  +     * Returns the name of the value to be used in help text.
  +     * For example, if the argument was -date and the value
  +     * name could be 'DD/MM/YYYY' which would be displayed in
  +     * the help text, rather than the default 'arg'.
  +     * 
  +     * @return
  +     *     the name to be displayed in the help text
  +     */
       public String getValueName();
  +    
  +    /**
  +     * Returns the number of values that this argument is permitted
  +     * to have.
  +     * 
  +     * @return
  +     *     the number of argument values
  +     */
       public int getSize();
  +    
  +    /**
  +     * Returns whether the values of this argument are optional.
  +     * If they are optional the argument is effectively an Option.
  +     * 
  +     * @return
  +     *     whether the values of this argument are optional
  +     */
       public boolean hasOptionalValues();
   }
  
  
  

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