public final class JSONParser extends AbstractParser
| Modifier and Type | Field and Description |
|---|---|
String |
json
The string JSON representation of the survey.
|
String |
source
A String indicating the survey source (e.g., filename, url).
|
allBlockLookUp, ANSWER, BLOCK, BRANCH, CORRELATION, correlationMap, CUSTOM_ID, defaultValues, EXCLUSIVE, FREETEXT, INPUT_SCHEMA, knownHeaders, LOGGER, OPTIONS, ORDERED, PERMIT_BREAKOFF, QUESTION, RANDOMIZE, RESOURCE, topLevelBlocks| Constructor and Description |
|---|
JSONParser(String json)
Returns a JSONParser for some string input JSON.
|
| Modifier and Type | Method and Description |
|---|---|
static JSONParser |
makeParser(String filename)
Creates a JSONParser from a source file containing the JSON represenatation of a survey.
|
Survey |
parse()
Validates and parses the survey.
|
addPhantomBlocks, boolType, initializeAllOneBlock, parseBool, parseComponent, propagateBranchParadigm, propagateBranchParadigmspublic final String json
public final String source
public JSONParser(String json)
makeParser.json - The JSON representation of a survey.public static JSONParser makeParser(String filename) throws IOException
filename - The source file name for the JSON represenation of the survey.IOExceptionpublic Survey parse() throws SurveyException
parse in class AbstractParserSurvey object.SurveyExceptionCopyright © 2015. All rights reserved.