JML

org.multijava.util.optgen
Class OptionDefinition

java.lang.Object
  extended byorg.multijava.util.optgen.OptionDefinition
All Implemented Interfaces:
SelectionVariables

class OptionDefinition
extends Object
implements SelectionVariables


Field Summary
private  String action
           
private  String argument
           
private  int caseValue
           
private  String defaultValue
           
private  String guiType
           
private  ArrayList help
           
private  String longname
           
private  ArrayList selection
           
static String selectionName
          Denotes the structure name that the option is using to store the different selections for that option
static String selectionType
          Denotes the structure type that the option is using to store the different selections for that option
private  String shortname
           
static String structureName
          Denotes the structure name that the option is using to store the data structrues that store the different selections for that option
private  ArrayList tableHeader
           
private  String type
           
 
Constructor Summary
OptionDefinition(String longname, String shortname, String action, String type, String defaultValue, String argument, ArrayList tableHeader, ArrayList selection, ArrayList help, int caseValue, String guiType)
          Constructs an option definition
 
Method Summary
 void checkIdentifiers(Hashtable identifiers, String sourceFile)
          Check for duplicate identifiers
 void checkShortcuts(Hashtable shortcuts, String sourceFile)
          Check for duplicate identifiers
private  String getType()
          Returns the correct type, based on whether it is of the type StringList, StringSystemProperty, or not
 void printCurrentValue(PrintWriter out)
          Prints the current value to interface file (java)
 void printDefaultValue(PrintWriter out)
          Prints the option default values to interface file (java)
 void printFieldAndAccessors(PrintWriter out)
          Prints the source-code for this option's field declaration and accessor method.
 void printGuiType(PrintWriter out)
          Prints the value of isNormal to interface file (java)
 void printHelpString(PrintWriter out)
          Prints the help strings to interface file (java)
 void printLongname(PrintWriter out)
          Prints the longname string to interface file (java)
 void printLongOpts(PrintWriter out)
           
 void printParseArgument(PrintWriter out)
          Prints the parse argument case statement to interface file (java)
 void printSelection(PrintWriter out)
          Prints the selection of the option to interface file (java)
 void printSetOption(PrintWriter out)
          Prints the set field case statement to interface file (java)
 void printShortOption(PrintWriter out)
           
 void printTableHeader(PrintWriter out)
          Prints the table header of the option to interface file (java)
 void printType(PrintWriter out)
          Prints the option type strings to interface file (java)
 void printUsage(PrintWriter out, String dashes)
          Prints the token definition to interface file (java)
private static String trail(String s)
           
private static ArrayList trailArrayList(ArrayList a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

longname

private final String longname

shortname

private final String shortname

action

private final String action

type

private final String type

defaultValue

private final String defaultValue

argument

private final String argument

tableHeader

private final ArrayList tableHeader

selection

private final ArrayList selection

help

private final ArrayList help

caseValue

private final int caseValue

guiType

private final String guiType

structureName

public static final String structureName
Denotes the structure name that the option is using to store the data structrues that store the different selections for that option


selectionType

public static final String selectionType
Denotes the structure type that the option is using to store the different selections for that option


selectionName

public static final String selectionName
Denotes the structure name that the option is using to store the different selections for that option

Constructor Detail

OptionDefinition

public OptionDefinition(String longname,
                        String shortname,
                        String action,
                        String type,
                        String defaultValue,
                        String argument,
                        ArrayList tableHeader,
                        ArrayList selection,
                        ArrayList help,
                        int caseValue,
                        String guiType)
Constructs an option definition

Method Detail

trail

private static final String trail(String s)

trailArrayList

private static final ArrayList trailArrayList(ArrayList a)

checkIdentifiers

public void checkIdentifiers(Hashtable identifiers,
                             String sourceFile)
                      throws OptgenError
Check for duplicate identifiers

Parameters:
identifiers - a table of all token identifiers
sourceFile - the file where the token is defined
Throws:
OptgenError

checkShortcuts

public void checkShortcuts(Hashtable shortcuts,
                           String sourceFile)
                    throws OptgenError
Check for duplicate identifiers

Parameters:
shortcuts - a table of all token identifiers
sourceFile - the file where the token is defined
Throws:
OptgenError

printParseArgument

public void printParseArgument(PrintWriter out)
Prints the parse argument case statement to interface file (java)

Parameters:
out - the output stream

printSetOption

public void printSetOption(PrintWriter out)
Prints the set field case statement to interface file (java)

Parameters:
out - the output stream

printFieldAndAccessors

public void printFieldAndAccessors(PrintWriter out)
Prints the source-code for this option's field declaration and accessor method.

Parameters:
out - the output stream

printUsage

public void printUsage(PrintWriter out,
                       String dashes)
Prints the token definition to interface file (java)

Parameters:
out - the output stream
dashes - the dashes to put in fron of the option

printLongname

public void printLongname(PrintWriter out)
Prints the longname string to interface file (java)

Parameters:
out - the output stream

printType

public void printType(PrintWriter out)
Prints the option type strings to interface file (java)

Parameters:
out - the output stream

printDefaultValue

public void printDefaultValue(PrintWriter out)
Prints the option default values to interface file (java)

Parameters:
out - the output stream

printCurrentValue

public void printCurrentValue(PrintWriter out)
Prints the current value to interface file (java)

Parameters:
out - the output stream

printTableHeader

public void printTableHeader(PrintWriter out)
Prints the table header of the option to interface file (java)

Parameters:
out - the output stream

printSelection

public void printSelection(PrintWriter out)
Prints the selection of the option to interface file (java)

Parameters:
out - the output stream

printHelpString

public void printHelpString(PrintWriter out)
Prints the help strings to interface file (java)

Parameters:
out - the output stream

printGuiType

public void printGuiType(PrintWriter out)
Prints the value of isNormal to interface file (java)

Parameters:
out - the output stream

printLongOpts

public void printLongOpts(PrintWriter out)

printShortOption

public void printShortOption(PrintWriter out)

getType

private String getType()
Returns the correct type, based on whether it is of the type StringList, StringSystemProperty, or not


JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.