Package edu.suffolk.litlab.efsp.utils
Class InfoCollector
java.lang.Object
edu.suffolk.litlab.efsp.utils.InfoCollector
- Direct Known Subclasses:
AllWrongCollector,FailFastCollector,NeverSubmitCollector
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Optional<FilingError> protected List<InterviewVariable> protected List<InterviewVariable> protected List<InterviewVariable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCodeError(CodesParser.CodeError err, InterviewVariable.VarBuilder varBuilder) addCrossRefError(CodesParser.CrossReferenceError err, InterviewVariable.VarBuilder varBuilder) voidvoidaddTextError(CodesParser.TextVarError err, InterviewVariable.VarBuilder varBuilder) voidvoiderror(FilingError err) abstract booleanfinished()Says if the Info collector is finished with the current unit of information and should break control flow and return.getWrong()booleanhasError()booleanvoidShould never throw exceptions, that's a silly java thing.voidpushAttributeStack(String variableName) requestVar(String localName, String description, String datatype) requestVar(String localName, String desc, String datatype, List<String> choices, Optional<String> currentVal) Creates an InterviewVariable with the correct stack information in the variable name.requestVar(String localName, String desc, List<String> choices) unwrap(com.hubspot.algebra.Result<String, CodesParser.TextVarError> res, InterviewVariable.VarBuilder varBuilder) unwrapCode(com.hubspot.algebra.Result<String, CodesParser.CodeError> res, InterviewVariable.VarBuilder varBuilder) unwrapOpt(com.hubspot.algebra.Result<Optional<String>, CodesParser.CodeError> res, InterviewVariable.VarBuilder varBuilder)
-
Field Details
-
optionalVars
-
requiredVars
-
wrongVars
-
err
-
variableAttributes
-
-
Constructor Details
-
InfoCollector
public InfoCollector()
-
-
Method Details
-
error
- Throws:
FilingError
-
hasError
public boolean hasError() -
finished
public abstract boolean finished()Says if the Info collector is finished with the current unit of information and should break control flow and return. -
okToSubmit
public boolean okToSubmit() -
addRequired
- Throws:
FilingError
-
addOptional
-
addWrong
- Throws:
FilingError
-
addCodeError
public InterviewVariable addCodeError(CodesParser.CodeError err, InterviewVariable.VarBuilder varBuilder) throws FilingError - Throws:
FilingError
-
addTextError
public InterviewVariable addTextError(CodesParser.TextVarError err, InterviewVariable.VarBuilder varBuilder) throws FilingError - Throws:
FilingError
-
addCrossRefError
public InterviewVariable addCrossRefError(CodesParser.CrossReferenceError err, InterviewVariable.VarBuilder varBuilder) throws FilingError - Throws:
FilingError
-
pushAttributeStack
-
popAttributeStack
public void popAttributeStack()Should never throw exceptions, that's a silly java thing. -
getRequired
-
getOptional
-
getWrong
-
requestVar
public InterviewVariable requestVar(String localName, String desc, String datatype, List<String> choices, Optional<String> currentVal) Creates an InterviewVariable with the correct stack information in the variable name.- Parameters:
localName-desc-datatype-choices-currentVal- the current value (if any) of the variable in this round of processing- Returns:
-
varBuilder
-
requestVar
-
requestVar
-
requestVar
-
unwrap
public String unwrap(com.hubspot.algebra.Result<String, CodesParser.TextVarError> res, InterviewVariable.VarBuilder varBuilder) throws FilingError- Throws:
FilingError
-
unwrapCode
public String unwrapCode(com.hubspot.algebra.Result<String, CodesParser.CodeError> res, InterviewVariable.VarBuilder varBuilder) throws FilingError- Throws:
FilingError
-
unwrapOpt
public Optional<String> unwrapOpt(com.hubspot.algebra.Result<Optional<String>, CodesParser.CodeError> res, InterviewVariable.VarBuilder varBuilder) throws FilingError- Throws:
FilingError
-
jsonSummary
-