You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */packageorg.apache.commons.cli2;importjava.util.ListIterator;/** * An Option that can process values passed on the command line in the form * "--file README". */publicinterfaceArgumentextendsOption { /** * Returns the initial separator character or * '\0' if no character has been set. * * @return char the initial separator character */chargetInitialSeparator(); /** * Processes the "README" style element of the argument. * * Values identified should be added to the CommandLine object in * association with this Argument. * * @see WriteableCommandLine#addValue(Option,Object) * * @param commandLine The CommandLine object to store results in. * @param args The arguments to process. * @param option The option to register value against. * @throws OptionException if any problems occur. */voidprocessValues( finalWriteableCommandLinecommandLine, finalListIteratorargs, finalOptionoption) throwsOptionException; /** * Adds defaults to a CommandLine. * * @param commandLine * The CommandLine object to store defaults in. * @param option * The Option to store the defaults against. */voiddefaultValues(finalWriteableCommandLinecommandLine, finalOptionoption); /** * Performs any necessary validation on the values added to the * CommandLine. * * Validation will typically involve using the * CommandLine.getValues(option) method to retrieve the values * and then either checking each value. Optionally the String * value can be replaced by another Object such as a Number * instance or a File instance. * * @see CommandLine#getValues(Option) * * @param commandLine The CommandLine object to query. * @param option The option to lookup values with. * @throws OptionException if any problems occur. */voidvalidate(finalWriteableCommandLinecommandLine, finalOptionoption) throwsOptionException; /** * Indicates whether argument values must be present for the CommandLine to * be valid. * * @see #getMinimum() * @see #getMaximum() * @return true iff the CommandLine will be invalid without at least one * value */booleanisRequired(); /** * Retrieves the minimum number of values required for a valid Argument * * @return the minimum number of values */intgetMinimum(); /** * Retrieves the maximum number of values acceptable for a valid Argument * * @return the maximum number of values */intgetMaximum();}
1
+
/**
2
+
* Licensed to the Apache Software Foundation (ASF) under one or more
3
+
* contributor license agreements. See the NOTICE file distributed with
4
+
* this work for additional information regarding copyright ownership.
5
+
* The ASF licenses this file to You under the Apache License, Version 2.0
6
+
* (the "License"); you may not use this file except in compliance with
7
+
* the License. You may obtain a copy of the License at
8
+
*
9
+
* 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
+
*/
17
+
packageorg.apache.commons.cli2;
18
+
19
+
importjava.util.ListIterator;
20
+
21
+
/**
22
+
* An Option that can process values passed on the command line in the form
23
+
* "--file README".
24
+
*/
25
+
publicinterfaceArgumentextendsOption {
26
+
27
+
/**
28
+
* Returns the initial separator character or
29
+
* '\0' if no character has been set.
30
+
*
31
+
* @return char the initial separator character
32
+
*/
33
+
chargetInitialSeparator();
34
+
35
+
/**
36
+
* Processes the "README" style element of the argument.
37
+
*
38
+
* Values identified should be added to the CommandLine object in
0 commit comments