01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.util.cmd;
10:
11: /**
12: * @author Gennady Krizhevsky
13: */
14: class NamedArg extends AbstractArg {
15:
16: protected NamedArg(String name, StringBuffer value) {
17: super (name, value);
18: }
19:
20: protected int initialize(String args[], int index) {
21: if (args.length <= index) {
22: throw new IllegalArgumentException("Command line param "
23: + getName() + " must be followed by a string");
24: }
25: StringBuffer argValue = (StringBuffer) getValue();
26: argValue.setLength(0);
27: if (args[index] != null) {
28: argValue.append(args[index]);
29: }
30: setInitialized(true);
31: return index + 1;
32: }
33: }
|