Class AbstractDatasetParser
- java.lang.Object
-
- com.github.mjeanroy.dbunit.core.parsers.AbstractDatasetParser
-
- All Implemented Interfaces:
DatasetParser
- Direct Known Subclasses:
AbstractJsonParser
,AbstractYamlParser
public abstract class AbstractDatasetParser extends Object implements DatasetParser
Abstract implementation ofDatasetParser
that createReader
from givenResource
and executedoParse(Reader)
.Note that exceptions thrown from
doParse(Reader)
method will automatically be wrapped intoJsonException
.
-
-
Constructor Summary
Constructors Constructor Description AbstractDatasetParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Map<String,List<Map<String,Object>>>
doParse(Reader reader)
Parse givenReader
: Read input. Create dataset model from it.Map<String,List<Map<String,Object>>>
parse(Resource resource)
Read File and return representation.protected abstract AbstractParserException
wrapException(Exception ex)
-
-
-
Method Detail
-
parse
public Map<String,List<Map<String,Object>>> parse(Resource resource)
Description copied from interface:DatasetParser
Read File and return representation.- Specified by:
parse
in interfaceDatasetParser
- Parameters:
resource
- Input resource.- Returns:
- DataSet representation.
-
doParse
protected abstract Map<String,List<Map<String,Object>>> doParse(Reader reader) throws Exception
Parse givenReader
:- Read input.
- Create dataset model from it.
- Parameters:
reader
- The reader.- Returns:
- The dataset input.
- Throws:
Exception
- If an error occurred during JSON parsing.
-
wrapException
protected abstract AbstractParserException wrapException(Exception ex)
-
-