|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcox.jmatt.java.MathTools.test.MTestParser
public class MTestParser
This simple class is designed to parse text into a MTest. The method used to add Questions is Question.parseQuestion()
and all default settings apply. A very simple macro language allows setting of options and MTFI
s. The input can come from a file, a resource
stream or a String of newline-separated text.
All macro commands start with the '@' character and consist of a single letter and possibly text afterward. The macro commands are:
The intent of this class is to allow quick creation of a simple MTest. Since MTest
is very much line-oriented it lends itself particularly
well to LaTeX. LaTeX handles its own page layout so line-orientation suffices for the raw input. Also, since a MTest can be set before data is parsed this
class can also be used to configure large parts of the test that don't really change.
Constructor Summary | |
---|---|
MTestParser()
The only constructor needed. |
Method Summary | |
---|---|
MTest |
parse(java.lang.String pData)
Parse a String into a MTest . |
MTest |
parseFile(java.lang.String pFile,
boolean pGRAS)
Parse a file into a MTest. |
MTestParser |
reset()
Reset the parser to its default values: true for autoclick and no pre-set MTest. |
MTestParser |
setAutoClick(boolean yesNo)
This method sets the global autoclick value. |
MTestParser |
setMTest(MTest pTest)
Use this method to set the MTest instance used to receive the parsed data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MTestParser()
Method Detail |
---|
public MTestParser setAutoClick(boolean yesNo)
click()
method is called.
public MTestParser setMTest(MTest pTest)
public MTestParser reset()
public MTest parse(java.lang.String pData)
MTest
. The parser breaks on newlines and this is not configurable.
pData
- The String to be parsed.public MTest parseFile(java.lang.String pFile, boolean pGRAS)
pFile
- The name of the file to parse.pGRAS
- true to getResourceAsStream()
, false for a file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |