Package de.isas.mztab2.io
Class MzTabFileParser
- java.lang.Object
-
- de.isas.mztab2.io.MzTabFileParser
-
public class MzTabFileParser extends Object
MZTabFileParser provides reading functionality of the mzTab file. During the parsing process, minimal integrity checks are preformed.- Since:
- 21/02/13
- Author:
- qingwei, nilshoffmann
-
-
Constructor Summary
Constructors Constructor Description MzTabFileParser(File tabFile)
Create a newMZTabFileParser
for the given file.MzTabFileParser(URI tabFileUri)
Create a newMZTabFileParser
for the given file URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkColunitMapping(MZTabColumnFactory columnFactory, Optional<Collection<ColumnParameterMapping>> columnParameterMapping, Metadata.Properties colUnitProperty, MzTab.Properties mzTabSection)
MZTabErrorList
getErrorList()
Getter for the fielderrorList
.MzTab
getMZTabFile()
getMZTabFile.MZTabErrorList
parse(OutputStream out)
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI.MZTabErrorList
parse(OutputStream out, MZTabErrorType.Level level)
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI.MZTabErrorList
parse(OutputStream out, MZTabErrorType.Level level, int maxErrorCount)
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI.
-
-
-
Constructor Detail
-
MzTabFileParser
public MzTabFileParser(File tabFile) throws IllegalArgumentException
Create a newMZTabFileParser
for the given file.- Parameters:
tabFile
- the MZTab file. The file SHOULD not be null and MUST exist- Throws:
IllegalArgumentException
- if the provided argument in invalid.
-
MzTabFileParser
public MzTabFileParser(URI tabFileUri) throws IllegalArgumentException
Create a newMZTabFileParser
for the given file URI.- Parameters:
tabFileUri
- the MZTab file URI. The file SHOULD not be null and MUST existMZTabErrorList
return bygetErrorList()
- Throws:
IllegalArgumentException
- if the provided argument in invalid.
-
-
Method Detail
-
parse
public MZTabErrorList parse(OutputStream out, MZTabErrorType.Level level, int maxErrorCount) throws IOException
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI. Parsing output and errors are written to the providedOutputStream
.- Parameters:
out
- the output stream for parsing messageslevel
- the minimum error level to report errors formaxErrorCount
- the maximum number of errors to report in theMZTabErrorList
return bygetErrorList()
- Returns:
- the error list
- Throws:
IOException
- if any io related errors occur.
-
parse
public MZTabErrorList parse(OutputStream out, MZTabErrorType.Level level) throws IOException
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI. Parsing output and errors are written to the providedOutputStream
. Reports up toMZTabProperties.MAX_ERROR_COUNT
errors.- Parameters:
out
- the output stream for parsing messageslevel
- the minimum error level to report errors for- Returns:
- the error list
- Throws:
IOException
- if any io related errors occur.
-
parse
public MZTabErrorList parse(OutputStream out) throws IOException
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI. Parsing output and errors are written to the providedOutputStream
. Reports up toMZTabProperties.MAX_ERROR_COUNT
errors on levelMZTabProperties.LEVEL
.- Parameters:
out
- the output stream for parsing messages- Returns:
- the error list
- Throws:
IOException
- if any io related errors occur.
-
getErrorList
public MZTabErrorList getErrorList()
Getter for the field
errorList
.- Returns:
- a
MZTabErrorList
object.
-
checkColunitMapping
protected void checkColunitMapping(MZTabColumnFactory columnFactory, Optional<Collection<ColumnParameterMapping>> columnParameterMapping, Metadata.Properties colUnitProperty, MzTab.Properties mzTabSection)
-
getMZTabFile
public MzTab getMZTabFile()
getMZTabFile.
- Returns:
- a
MzTab
object.
-
-