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 newMZTabFileParserfor the given file.MzTabFileParser(URI tabFileUri)Create a newMZTabFileParserfor the given file URI. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckColunitMapping(MZTabColumnFactory columnFactory, Optional<Collection<ColumnParameterMapping>> columnParameterMapping, Metadata.Properties colUnitProperty, MzTab.Properties mzTabSection)MZTabErrorListgetErrorList()Getter for the fielderrorList.MzTabgetMZTabFile()getMZTabFile.MZTabErrorListparse(OutputStream out)Create a newMZTabParserContextandMZTabErrorListfor the given file URI.MZTabErrorListparse(OutputStream out, MZTabErrorType.Level level)Create a newMZTabParserContextandMZTabErrorListfor the given file URI.MZTabErrorListparse(OutputStream out, MZTabErrorType.Level level, int maxErrorCount)Create a newMZTabParserContextandMZTabErrorListfor the given file URI. 
 - 
 
- 
- 
Constructor Detail
- 
MzTabFileParser
public MzTabFileParser(File tabFile) throws IllegalArgumentException
Create a newMZTabFileParserfor 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 newMZTabFileParserfor the given file URI.- Parameters:
 tabFileUri- the MZTab file URI. The file SHOULD not be null and MUST existMZTabErrorListreturn 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 newMZTabParserContextandMZTabErrorListfor 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 theMZTabErrorListreturn 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 newMZTabParserContextandMZTabErrorListfor the given file URI. Parsing output and errors are written to the providedOutputStream. Reports up toMZTabProperties.MAX_ERROR_COUNTerrors.- 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 newMZTabParserContextandMZTabErrorListfor the given file URI. Parsing output and errors are written to the providedOutputStream. Reports up toMZTabProperties.MAX_ERROR_COUNTerrors 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 
MZTabErrorListobject. 
 
- 
checkColunitMapping
protected void checkColunitMapping(MZTabColumnFactory columnFactory, Optional<Collection<ColumnParameterMapping>> columnParameterMapping, Metadata.Properties colUnitProperty, MzTab.Properties mzTabSection)
 
- 
getMZTabFile
public MzTab getMZTabFile()
getMZTabFile.
- Returns:
 - a 
MzTabobject. 
 
 - 
 
 -