01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.commons.cli;
17:
18: import java.util.Properties;
19:
20: /**
21: * A class that implements the <code>CommandLineParser</code> interface
22: * can parse a String array according to the {@link Options} specified
23: * and return a {@link CommandLine}.
24: *
25: * @author John Keyes (john at integralsource.com)
26: */
27: public interface CommandLineParser {
28:
29: /**
30: * Parse the arguments according to the specified options.
31: *
32: * @param options the specified Options
33: * @param arguments the command line arguments
34: * @return the list of atomic option and value tokens
35: *
36: * @throws ParseException if there are any problems encountered
37: * while parsing the command line tokens.
38: */
39: CommandLine parse(Options options, String[] arguments)
40: throws ParseException;
41:
42: /**
43: * Parse the arguments according to the specified options and
44: * properties.
45: *
46: * @param options the specified Options
47: * @param arguments the command line arguments
48: * @param properties command line option name-value pairs
49: * @return the list of atomic option and value tokens
50: *
51: * @throws ParseException if there are any problems encountered
52: * while parsing the command line tokens.
53: */
54: /* To maintain binary compatibility, this is commented out.
55: It is still in the abstract Parser class, so most users will
56: still reap the benefit.
57: CommandLine parse(Options options, String[] arguments,
58: Properties properties)
59: throws ParseException;
60: */
61:
62: /**
63: * Parse the arguments according to the specified options.
64: *
65: * @param options the specified Options
66: * @param arguments the command line arguments
67: * @param stopAtNonOption specifies whether to continue parsing the
68: * arguments if a non option is encountered.
69: *
70: * @return the list of atomic option and value tokens
71: * @throws ParseException if there are any problems encountered
72: * while parsing the command line tokens.
73: */
74: CommandLine parse(Options options, String[] arguments,
75: boolean stopAtNonOption) throws ParseException;
76:
77: /**
78: * Parse the arguments according to the specified options and
79: * properties.
80: *
81: * @param options the specified Options
82: * @param arguments the command line arguments
83: * @param properties command line option name-value pairs
84: * @param stopAtNonOption specifies whether to continue parsing the
85: *
86: * @return the list of atomic option and value tokens
87: * @throws ParseException if there are any problems encountered
88: * while parsing the command line tokens.
89: */
90: /* To maintain binary compatibility, this is commented out.
91: It is still in the abstract Parser class, so most users will
92: still reap the benefit.
93: CommandLine parse(Options options, String[] arguments,
94: Properties properties, boolean stopAtNonOption)
95: throws ParseException;
96: */
97: }
|