001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.cli2;
018
019import java.util.ListIterator;
020
021/**
022 * An Option that can have an argument and/or group of child Options in the form
023 * "-f <arg> [-a|-b|-c]".
024 */
025public interface Parent extends Option {
026
027    /**
028     * Processes the parent part of the Option.  The combination of parent,
029     * argument and children is handled by the process method.
030     * @see Option#process(WriteableCommandLine, ListIterator)
031     *
032     * @param commandLine the CommandLine to write results to
033     * @param args a ListIterator over argument strings positioned at the next
034     *             argument to process
035     * @throws OptionException if an error occurs while processing
036     */
037    void processParent(
038        final WriteableCommandLine commandLine,
039        final ListIterator args)
040        throws OptionException;
041}