public class CSVParser extends AbstractParser
allBlockLookUp, ANSWER, BLOCK, BRANCH, CORRELATION, correlationMap, CUSTOM_ID, defaultValues, EXCLUSIVE, FREETEXT, INPUT_SCHEMA, knownHeaders, LOGGER, OPTIONS, ORDERED, QUESTION, RANDOMIZE, RESOURCE, topLevelBlocks
Constructor and Description |
---|
CSVParser(CSVLexer lexer)
Constructor for the parser; takes a
CSVLexer as input. |
Modifier and Type | Method and Description |
---|---|
String |
cleanStrId(String id)
Removes randomization prefix flags.
|
Map<String,Block> |
getAllBlockLookUp()
Returns a map of all blocks, including top-level-blocks, sub-blocks, and "phantom" blocks.
|
Survey |
parse()
Parses the csv lexed by the input to the CSVParser's constructor.
|
static Component |
parseComponent(CSVEntry csvEntry,
int index)
|
addPhantomBlocks, boolType, initializeAllOneBlock, parseBool, parseComponent, propagateBranchParadigm, propagateBranchParadigms
public static Component parseComponent(CSVEntry csvEntry, int index)
csvEntry
- The cell in the input csv.index
- The relative index of this component in relation to its containing logical unit. If the entry being
parsed is part of a Question
, then the relative index is in
relation to the other components that comprise this question. (This is legacy from the deprecated
RESOURCE column header.
public String cleanStrId(String id)
id
- The string representation of the block identifierpublic Map<String,Block> getAllBlockLookUp()
Block
s' string identifiers to their internal
representations.public Survey parse() throws SurveyException
CSVLexer
.CSVLexer
parse
in class AbstractParser
Survey
objectSurveyException
Copyright © 2015. All rights reserved.