org.beanmaker.util
Class Arguments

java.lang.Object
  |
  +--org.beanmaker.util.Arguments

public class Arguments
extends java.lang.Object

Utility like Unix getopt.

Version:
$id$
Author:
Jeffrey Rodriguez This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation and was originally based on software copyright (c) 1999, International Business Machines, Inc., http://www.apache.org. For more information on the Apache Software Foundation, please see .

Constructor Summary
Arguments()
           
 
Method Summary
 int getArguments()
          Return argument
 java.lang.String getlistFiles()
           
 java.lang.String getStringParameter()
          Return String parameter
 void parseArgumentTokens(java.lang.String[] arguments, char[] argsWithOptions)
          Takes the array of standar Args passed from main method and parses the '-' and the characters after arg.
 void printUsage()
           
 void setUsage(java.lang.String[] message)
           
 int stringParameterLeft()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Arguments

public Arguments()
Method Detail

parseArgumentTokens

public void parseArgumentTokens(java.lang.String[] arguments,
                                char[] argsWithOptions)
Takes the array of standar Args passed from main method and parses the '-' and the characters after arg. - The value -1 is a special flag that is used to indicate the beginning of the queue of flags and it is also to tell the end of a group of switches. This method will generate 3 internal queues. - A queue that has the switch flag arguments. e.g. -dvV will hold d, v, V, -1. - A queue holding the string arguments needed by the switch flag arguments. If character -p requires a string argument. The string argument is saved in the string argument queue. - A queue holding a list of files string parameters not associated with a switch flag. -a -v -p myvalue test.xml test1.xml this queue will containt test.xml test1.xml

Parameters:
arguments -
argsWithOptions -

getArguments

public int getArguments()
Return argument

Returns:
int

getStringParameter

public java.lang.String getStringParameter()
Return String parameter

Returns:
String

getlistFiles

public java.lang.String getlistFiles()

stringParameterLeft

public int stringParameterLeft()

setUsage

public void setUsage(java.lang.String[] message)

printUsage

public void printUsage()


Copyright © 2002 Giovanni Martone.