[Java] Class GroovyPosixParser

org.codehaus.groovy.cli.GroovyPosixParser

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.

Methods Summary

Methods

Type

Name and description

protected void

burstToken(String token, boolean stopAtNonOption)Breaks token into its constituent parts
using the following algorithm.

if stopAtNonOption is true then do not
burst anymore of arguments entries, just add each
successive entry without further processing. Otherwise, ignore
stopAtNonOption.

if the current arguments entry is "--"
just add the entry to the list of processed tokens

if the current arguments entry is "-"
just add the entry to the list of processed tokens

if the current arguments entry is two characters
in length and the first character is "-" then check if this
is a valid Option id. If it is a valid id, then add the
entry to the list of processed tokens and set the current Option
member. If it is not a valid id and stopAtNonOption
is true, then the remaining entries are copied to the list of
processed tokens. Otherwise, the current entry is ignored.

if the current arguments entry is more than two
characters in length and the first character is "-" then
we need to burst the entry to determine its constituents. For more
information on the bursting algorithm see
burstToken.

if the current arguments entry is not handled
by any of the previous rules, then the entry is added to the list
of processed tokens.