FileDocCategorySizeDatePackage
Arguments.javaAPI DocExample1390Sun Jul 07 09:56:12 BST 2002javajaxb.util

Arguments

public class Arguments extends Hashtable

Fields Summary
Constructors Summary
public Arguments()

        super();
    
public Arguments(String[] args)

        super();
        setValues(args);
    
Methods Summary
public java.lang.StringgetValue(java.lang.String argumentName)

        return (String)get(argumentName);
    
public booleanhasValue(java.lang.String argumentName)

        return (get(argumentName) != null);
    
public voidsetValue(java.lang.String argumentName, java.lang.String argumentValue)

        if (argumentName == null) {
            throw new IllegalArgumentException("An Arguments object cannot " +
                "have a null argument name.");
        }
        put(argumentName, argumentValue);
    
public voidsetValues(java.lang.String[] args)

        int equalsPosition = -1;

        for (int i = 0; i < args.length; i++) {
            String arg = args[i];
            equalsPosition = arg.indexOf("=");

            if ( equalsPosition == -1 ) {
                System.err.println("The argument you specified, '"
                    + arg + "' doesn't contain an '='.\n"
                    + "All arguments must be of the form 'foo=bar'.");
                System.exit(1);
            }

            put(arg.substring(0, equalsPosition), 
                arg.substring(equalsPosition + 1));
        }