Package de.hybris.platform.impex.jalo
Class ScriptValidationReader
java.lang.Object
de.hybris.platform.impex.jalo.ImpExReader
de.hybris.platform.impex.jalo.ScriptValidationReader
This reader can be used for validating an script. At the moment you can only validate the first until the first
header definition. Just use it like a normal
ImpExReader by calling readLine for one time.
If the call passes all is OK.-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.impex.jalo.ImpExReader
ImpExReader.ResultSetCSVReader -
Field Summary
Fields inherited from class de.hybris.platform.impex.jalo.ImpExReader
FIRST -
Constructor Summary
ConstructorsConstructorDescriptionScriptValidationReader(CSVReader reader, EnumerationValue mode) ScriptValidationReader(CSVReader reader, EnumerationValue mode, DocumentIDRegistry docIdRegistry) Creates a new validator using the given reader.ScriptValidationReader(CSVReader reader, String mode) -
Method Summary
Modifier and TypeMethodDescriptionreadLine()Fetches the next line, parses it and returns it encapsulated in aHeaderDescriptorif the line was a header definition or aValueLineif it was a data row.voidstatic voidvalidateScript(CSVReader reader) Validates a script using the given reader.static voidvalidateScript(InputStream inputStream, String encoding) Validates a script using the given stream.Methods inherited from class de.hybris.platform.impex.jalo.ImpExReader
addDefinition, addExternalDataMedia, addExternalDataMedias, addHeaderExceptionInfoAsComment, addHeaderReplacementRule, addToBeanShellContext, adjustLineIndexes, applyHeaderReplacements, assureBeanShellLoaded, checkDefinitonKey, close, createCodeLine, createCodeLineLegacyWay, createCodeLineModernWay, createInvalidHeader, createNewHeader, createValueLine, debug, debug, enableCodeExecution, enableExternalCodeExecution, enableExternalDataCodeExecution, enableExternalImpExSyntaxParsing, enableExternalSyntaxParsing, enterIfBlock, error, error, execute, execute, exitIfBlock, findExternalDataMedia, findExternalDataMedia, findMarker, getAllExternalDataMediaCodes, getAttributeConstraintFilter, getBeforeEachCode, getCellDecorators, getCSVReader, getCurrentHeader, getCurrentLocation, getCurrentReader, getDefaultReplacements, getDocumentIDRegistry, getFromBeanShellContext, getInvalidHeaderPolicy, getLineSize, getLocale, getScriptExecutionContext, getStrictMode, getValidationMode, gotInsertedLines, hasCellDecorators, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalData, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeExternalDataMedia, includeSQLData, includeSQLData, includeSQLData, info, info, initDatabase, insertLine, isCodeExecutionEnabled, isCodeLine, isCombinedSearchEnabled, isCommentLine, isDebugEnabled, isDefinition, isEmptyLine, isEndUserRights, isExternalCodeExecutionEnabled, isExternalSyntaxParsingEnabled, isHeaderLine, isIncludingExternalData, isInfoEnabled, isNotInInactiveIfBlock, isStartUserRights, legacyExecute, lineToList, modernExecute, parseHeader, parseHeader, parseHeader, parseHeader, processCodeLine, processMarkerCodeLine, readNextCSVLine, removeExternalDataMedia, removeExternalDataMedias, replaceDefinitions, setAttributeConstraintFilter, setBeanShellContext, setBeforeEachCode, setCellDecorators, setCurrentHeader, setCurrentHeader, setInvalidHeaderPolicy, setLocale, setRelaxedMode, setRelaxedMode, setValidationMode, setValidationMode, sortRulesList, splitDefinitonCell, storeUserRightsLine, warn, warn, writeUserRightsLines
-
Constructor Details
-
ScriptValidationReader
-
ScriptValidationReader
-
ScriptValidationReader
public ScriptValidationReader(CSVReader reader, EnumerationValue mode, DocumentIDRegistry docIdRegistry) Creates a new validator using the given reader.- Parameters:
reader- reader from which the script will be read
-
-
Method Details
-
readLine
Description copied from class:ImpExReaderFetches the next line, parses it and returns it encapsulated in aHeaderDescriptorif the line was a header definition or aValueLineif it was a data row.- Overrides:
readLinein classImpExReader- Returns:
- either
HeaderDescriptororValueLineinstances or null if end of data is reached. - Throws:
ImpExException- if a header could not be parsed properly
-
validateScript
Validates a script using the given reader. The call will pass if the script is valid.- Parameters:
reader- reader holding the stream to check.- Throws:
ImpExException- script is not valid
-
validateScript
Validates a script using the given stream. The call will pass if the script is valid.- Parameters:
inputStream- stream to scriptencoding- used encoding- Throws:
ImpExException- script is not valid
-
validateScript
- Throws:
ImpExException
-