public class ValuesFile extends java.lang.Object implements ValuesFileConstants
File format parser for a PCD values file.
A PCD value file is specified as follows:
Each line of a PCD values file contains a key value pair. The key corresponds to the name (used for command line substitutions) of the PCD widget, the value corresponds to the new value to set the widget to. The line begins with the name of the key, followed by an equals sign or colon, then the value. The value may be enclosed in either single or double quotation marks. If the value is not enclosed in quotation marks then the value MUST not have any whitespace in-between. If the value is enclosed in quotation marks (either single or double), then whitespace (including the carriage-return and newline characters) may be used as part of the value. Please note that if you wish to use the double-quote character as part of a value which is enclosed in double-quotation marks, then you just need to double the double-quotation marks.
NOTE: any whitespace between the key, colon or equals sign, and the value, is allowed and ignored.
NOTE: the key may ALSO be enclosed in quotation marks (single or double).
Modifier and Type | Field and Description |
---|---|
Token |
jj_nt
Next token.
|
Token |
token
Current token.
|
ValuesFileTokenManager |
token_source
Generated Token Manager.
|
Constructor and Description |
---|
ValuesFile(java.io.InputStream stream)
Constructor with InputStream.
|
ValuesFile(java.io.InputStream stream,
java.lang.String encoding)
Constructor with InputStream and supplied encoding
|
ValuesFile(java.io.Reader stream)
Constructor.
|
ValuesFile(ValuesFileTokenManager tm)
Constructor with generated Token Manager.
|
Modifier and Type | Method and Description |
---|---|
void |
disable_tracing()
Disable tracing.
|
void |
enable_tracing()
Enable tracing.
|
ParseException |
generateParseException()
Generate ParseException.
|
Token |
getNextToken()
Get the next Token.
|
Token |
getToken(int index)
Get the specific Token.
|
void |
parse(java.util.Map<java.lang.String,org.biopcd.widgets.Widget> widgets)
Begin parsing the PCD values file.
|
java.lang.String |
parseColumn()
Parse a column/cell in a PCD values file.
|
void |
parseRow(java.util.Map<java.lang.String,org.biopcd.widgets.Widget> results)
Parse a single row/line in a PCD values file.
|
static void |
readValues(java.io.Reader currentFile,
java.util.Map<java.lang.String,org.biopcd.widgets.Widget> widgets)
Parse a PCD values file, and set all of the values for all widgets
(with values specified in the file) contained in the map 'widgets'.
|
void |
ReInit(java.io.InputStream stream)
Reinitialise.
|
void |
ReInit(java.io.InputStream stream,
java.lang.String encoding)
Reinitialise.
|
void |
ReInit(java.io.Reader stream)
Reinitialise.
|
void |
ReInit(ValuesFileTokenManager tm)
Reinitialise.
|
public ValuesFileTokenManager token_source
public Token token
public Token jj_nt
public ValuesFile(java.io.InputStream stream)
public ValuesFile(java.io.InputStream stream, java.lang.String encoding)
public ValuesFile(java.io.Reader stream)
public ValuesFile(ValuesFileTokenManager tm)
public static void readValues(java.io.Reader currentFile, java.util.Map<java.lang.String,org.biopcd.widgets.Widget> widgets) throws java.io.IOException
currentFile
- the PCD values file to parse.widgets
- the map of widgets to set the values for.java.io.IOException
public final void parse(java.util.Map<java.lang.String,org.biopcd.widgets.Widget> widgets) throws ParseException
widgets
- the map of widgets to set the values for.ParseException
public final void parseRow(java.util.Map<java.lang.String,org.biopcd.widgets.Widget> results) throws ParseException
results
- the map of widgets to set the values for.ParseException
public final java.lang.String parseColumn() throws ParseException
ParseException
public void ReInit(java.io.InputStream stream)
public void ReInit(java.io.InputStream stream, java.lang.String encoding)
public void ReInit(java.io.Reader stream)
public void ReInit(ValuesFileTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
Copyright © 2008-2022 University of Manitoba.