com.meyling.principia.module
Class SimpleModuleCreator

java.lang.Object
  |
  +--com.meyling.principia.module.SimpleModuleCreator

public final class SimpleModuleCreator
extends Object

This class provides static methods for reading and writing an Argument of the module package.

Version:
$Revision 0.00.50$
Author:
Michael Meyling

Field Summary
private static Map class2string
          for converting a (Argument) class into an String
private static Map string2class
          for converting a String into an (Argument) class
 
Constructor Summary
SimpleModuleCreator()
           
 
Method Summary
(package private) static void ()
          Make attribut initialization.
static Map getMap()
          Get the mapping of Strings to operator classes.
static String getName(Class c)
          Get name of known operator class.
static Argument readArgument(TextInput input, ParsingTable parsing)
          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, registerNatives, toString, wait, wait, wait
 

Field Detail

string2class

private static final Map string2class
for converting a String into an (Argument) class

class2string

private static final Map class2string
for converting a (Argument) class into an String
Constructor Detail

SimpleModuleCreator

public SimpleModuleCreator()
Method Detail

static void ()
Make attribut initialization.

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 c)
                            throws IllegalArgumentException
Get name of known operator class.
Parameters:
c - look for name of this class
Returns:
name of operator class
Throws:
IllegalArgumentException - if operator class c is unknown

readArgument

public static final Argument readArgument(TextInput input,
                                          ParsingTable parsing)
                                   throws ParsingException
Create an Argument out of an TextInput object.
Parameters:
input - source to read from
parsing - maps Arguments into Positions
Returns:
new generated 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