com.meyling.principia.argument
Class ArgumentCreator
java.lang.Object
|
+--com.meyling.principia.argument.ArgumentCreator
- public final class ArgumentCreator
- extends Object
This class provides static methods for reading and
writing an Argument.
- Version:
- $Revision 0.00.50$
- Author:
- Michael Meyling
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
ArgumentCreator
public ArgumentCreator()
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 generateargument - argument for constructor of that class- Returns:
- new generated Argument
- Throws:
ArgumentException - if creation failedIllegalArgumentException - if creation failed
because of a programming error
readArgument
public static final Argument readArgument(TextInput input,
Map string2class,
ParsingTable parsing)
throws ParsingException
- Create an
Argument out of an TextInput object.
- Parameters:
input - source to read fromstring2class - use this mapping for parsingparsing - for saving positions of created arguments- Returns:
- created argument
- Throws:
ParsingException - if creation failed
readArgumentList
private static final Argument[] readArgumentList(TextInput input,
Map string2class,
ParsingTable parsing)
throws ParsingException
- Create an argument array out of an
TextInput object.
- Parameters:
input - source to read fromstring2class - use this mapping for parsingparsing - for saving positions of created arguments- Returns:
- created arguments
- Throws:
ParsingException - if creation failed
writeArgument
public static final void writeArgument(Output output,
Argument argument,
Map class2string)
throws IllegalArgumentException
- Write an
Argument to an Output object.
- Parameters:
output - destination to write toargument - this object will be writtenclass2string - use this mapping for getting a string- Throws:
IllegalArgumentException - if writing failed
writeArgument
public static final String writeArgument(Argument argument,
Map class2string)
throws IllegalArgumentException
- Write an
Argument to an String.
- Parameters:
argument - this object will be writtenclass2string - use this mapping for getting a string- Returns:
- created string
- Throws:
IllegalArgumentException - if writing failed