Hilbert II - JAVA-Packages - Principia Mathematica II

com.meyling.principia.module
Class ModuleCreator

java.lang.Object
  extended bycom.meyling.principia.module.ModuleCreator

public final class ModuleCreator
extends Object

This class provides static methods for reading and writing an Module and its subcomponents.

Version:
$Revision: 1.10 $
Author:
Michael Meyling

Field Summary
static String MODULE_AUTHOR
          string for a Author
static String MODULE_AUTHOR_LIST
          string for a AuthorList
static String MODULE_DESCRIPTION
          string for a Description
static String MODULE_EMAIL
          string for a Email
static String MODULE_HEADER
          string for a Header
static String MODULE_HEADLINE
          string for a Headline
static String MODULE_IMPORT
          string for a Import
static String MODULE_IMPORT_LIST
          string for a ImportList
static String MODULE_LOCATION
          string for a Location
static String MODULE_LOCATION_LIST
          string for a LocationList
static String MODULE_MODULE
          string for a Module
static String MODULE_NAME
          string for a Name
static String MODULE_PARAGRAPH_LIST
          string for a ParagraphList
static String MODULE_SPECIFICATION
          string for a Specification
static String MODULE_USEDBY_LIST
          string for a UsedbyList
static String MODULE_VERSION
          string for a Version
 
Constructor Summary
ModuleCreator(TextInput input)
          Constructs a new module creator.
 
Method Summary
static Argument createArgument(Class kind, Argument[] argument)
          Creates a new Argument.
static Class getClass(String name)
          Get class for known name of operator.
static Map getMap()
          Get the mapping of Strings to operator classes.
static String getName(Class clazz)
          Get name of known operator class.
 Argument readArgument()
          Create an Argument out of an TextInput object.
static String writeArgument(Argument argument)
          Write an Argument to an String.
static void writeArgument(Output output, Argument argument)
          Write an Argument to an Output object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE_PARAGRAPH_LIST

public static final String MODULE_PARAGRAPH_LIST
string for a ParagraphList

See Also:
Constant Field Values

MODULE_MODULE

public static final String MODULE_MODULE
string for a Module

See Also:
Constant Field Values

MODULE_IMPORT_LIST

public static final String MODULE_IMPORT_LIST
string for a ImportList

See Also:
Constant Field Values

MODULE_IMPORT

public static final String MODULE_IMPORT
string for a Import

See Also:
Constant Field Values

MODULE_NAME

public static final String MODULE_NAME
string for a Name

See Also:
Constant Field Values

MODULE_VERSION

public static final String MODULE_VERSION
string for a Version

See Also:
Constant Field Values

MODULE_LOCATION_LIST

public static final String MODULE_LOCATION_LIST
string for a LocationList

See Also:
Constant Field Values

MODULE_LOCATION

public static final String MODULE_LOCATION
string for a Location

See Also:
Constant Field Values

MODULE_SPECIFICATION

public static final String MODULE_SPECIFICATION
string for a Specification

See Also:
Constant Field Values

MODULE_HEADER

public static final String MODULE_HEADER
string for a Header

See Also:
Constant Field Values

MODULE_DESCRIPTION

public static final String MODULE_DESCRIPTION
string for a Description

See Also:
Constant Field Values

MODULE_HEADLINE

public static final String MODULE_HEADLINE
string for a Headline

See Also:
Constant Field Values

MODULE_EMAIL

public static final String MODULE_EMAIL
string for a Email

See Also:
Constant Field Values

MODULE_AUTHOR_LIST

public static final String MODULE_AUTHOR_LIST
string for a AuthorList

See Also:
Constant Field Values

MODULE_AUTHOR

public static final String MODULE_AUTHOR
string for a Author

See Also:
Constant Field Values

MODULE_USEDBY_LIST

public static final String MODULE_USEDBY_LIST
string for a UsedbyList

See Also:
Constant Field Values
Constructor Detail

ModuleCreator

public ModuleCreator(TextInput input)
Constructs a new module creator.

Parameters:
input - read from here
Method Detail

getMap

public static final Map getMap()
Get the mapping of Strings to operator classes. The returned Map should not be modified.

Returns:
mapping of known Strings, do not change this Map

getName

public static final String getName(Class clazz)
                            throws IllegalArgumentException
Get name of known operator class.

Parameters:
clazz - look for name of this class
Returns:
name of operator class
Throws:
IllegalArgumentException - if operator class clazz is unknown

getClass

public static final Class getClass(String name)
                            throws IllegalArgumentException
Get class for known name of operator.

Parameters:
name - look for class with this name
Returns:
class with this name
Throws:
IllegalArgumentException - if no class with this name known

createArgument

public static final Argument createArgument(Class kind,
                                            Argument[] argument)
                                     throws IllegalArgumentException,
                                            ArgumentException
Creates a new Argument. Could't create a new Counter or a Text.

Parameters:
kind - class to generate
argument - argument for constructor of that class
Returns:
new generated Argument
Throws:
ArgumentException - if creation failed
IllegalArgumentException - if creation failed because of a programming error

readArgument

public final Argument readArgument()
                            throws ParsingException
Create an Argument out of an TextInput object.

Returns:
created argument
Throws:
ParsingException - if creation failed

writeArgument

public static final void writeArgument(Output output,
                                       Argument argument)
                                throws IllegalArgumentException
Write an Argument to an Output object.

Parameters:
output - destination to write to
argument - this object will be written
Throws:
IllegalArgumentException - if writing failed

writeArgument

public static final String writeArgument(Argument argument)
                                  throws IllegalArgumentException
Write an Argument to an String.

Parameters:
argument - this object will be written
Returns:
created string
Throws:
IllegalArgumentException - if writing failed

Hilbert II - JAVA-Packages - Principia Mathematica II

©left GNU General Public Licence
All Rights Reserved.