JML

org.multijava.util.msggen
Class DefinitionFile

java.lang.Object
  extended byorg.multijava.util.msggen.DefinitionFile

class DefinitionFile
extends Object


Field Summary
private static String DEFAULT_PREFIX
           
private  MessageDefinition[] definitions
           
private  String packageName
           
private  String prefix
           
private  String sourceFile
           
 
Constructor Summary
DefinitionFile(String sourceFile, String packageName, String prefix, ArrayList definitions)
          Constructs a token definition file
 
Method Summary
 void checkIdentifiers(Hashtable identifiers)
          Check for duplicate identifiers
 String getClassName()
          Returns the package name
 String getPackageName()
          Returns the package name
 String getPrefix()
          Returns the literal prefix
 void printFile(PrintWriter out)
          Prints the token definition to interface file (java)
static DefinitionFile read(String sourceFile)
          Reads and parses an token definition file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PREFIX

private static final String DEFAULT_PREFIX

sourceFile

private final String sourceFile

packageName

private final String packageName

prefix

private final String prefix

definitions

private final MessageDefinition[] definitions
Constructor Detail

DefinitionFile

public DefinitionFile(String sourceFile,
                      String packageName,
                      String prefix,
                      ArrayList definitions)
Constructs a token definition file

Method Detail

read

public static DefinitionFile read(String sourceFile)
                           throws MsggenError
Reads and parses an token definition file

Parameters:
sourceFile - the name of the source file
Returns:
a class info structure holding the information from the source
Throws:
MsggenError

checkIdentifiers

public void checkIdentifiers(Hashtable identifiers)
                      throws MsggenError
Check for duplicate identifiers

Parameters:
identifiers - a table of all token identifiers
Returns:
the id of the last token + 1
Throws:
MsggenError

printFile

public void printFile(PrintWriter out)
Prints the token definition to interface file (java)

Parameters:
out - the output stream

getClassName

public String getClassName()
Returns the package name


getPackageName

public String getPackageName()
Returns the package name


getPrefix

public String getPrefix()
Returns the literal prefix


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.