public class IDFParser extends AbstractParser<IDF>
IDF object.
 
 This class implements the Parser interface to generate IDF objects from an input stream.  The data being read
 from this input stream should be compliant with the IDF part of MAGE-TAB specification.
 
 This parser parses IDF by delegating to a series of IDFReadHandlers.
 These handlers are discovered at runtime by service provider discovery using the fluxion-spi library, which is an
 implementation of  the Sun Service Provider interface specification.  By adding new IDFReadHandlers annotated with a ServiceProvider annotation to the classpath, it is easy to extend the parser to read new
 or custom sections of an IDF documents
 
 The lifecycle for this parser is as follows. IDFReadHandlers
 in order to populate the IDF object modelValidator and Converter
 instances on creation.
 
 Because this class discovers available Handler implementations in
 order to perform parse, validate and convert functions, and is therefore extensible with arbitrarily complex
 operations, it supports asynchronous invocation of all of it's methods.  You can leverage this ability by passing an
 ExecutorService to any of this classes appropriate methods, although callers will need to be responsible for managing
 the startup and shutdown of this service.  The forms which accept an ExecutorService as a parameter execute
 asynchronously.  Those forms of methods which do not take an ExecutorService execute in a single threaded manner and
 are blocking methods.MAGETABParser, 
SDRFParser, 
IDFAbstractParser.DefaultHandlerListenerDEFAULT_ENCODING| Constructor and Description | 
|---|
IDFParser()  | 
| Modifier and Type | Method and Description | 
|---|---|
IDF | 
parse(File idfFile)  | 
IDF | 
parse(InputStream idfIn)
Performs parsing from the specified input stream source, populating an  
IDF object which is returned. | 
IDF | 
parse(InputStream idfIn,
     IDF idf)
Alternate form of the  
parse(java.io.InputStream) method that allows callers to specify the IDF object
 they want to be populated. | 
IDF | 
parse(InputStream idfIn,
     IDF idf,
     ExecutorService service)
Alternate form of the  
parse(java.io.InputStream) method that allows callers to specify both the IDF
 object they wish to be populated and an executor service that should be used to execute all IDF handler tasks. | 
IDF | 
parse(URL idfURL)  | 
protected void | 
read(String[][] idfData,
    IDF idf,
    ExecutorService service)
Reads tabulated IDF data into the supplied IDF object, delegating the execution of handling tasks to the supplied
 ExecutorService. 
 | 
addErrorItemListener, addProgressListener, fireErrorItemEvent, fireParseEvent, fireParsingCompletedEvent, fireParsingFailedEvent, fireParsingStartedEvent, getEncoding, getErrorItemListeners, getLog, getProgressListeners, isStrippingEscaping, removeErrorItemListener, removeProgressListener, setEncoding, setStripEscapingpublic IDF parse(File idfFile) throws ParseException
ParseExceptionpublic IDF parse(URL idfURL) throws ParseException
ParseExceptionpublic IDF parse(InputStream idfIn) throws ParseException
IDF object which is returned. This
 class will generate ErrorItems in response to any errors in the IDF file it detects, and report them via
 any registered ErrorItemListeners.
 
 A ParseException will be thrown if and only if there was a problem with the IDF input stream that meant
 the document was unparseable. You not use the absence of a parse exception to indicate that parsing was
 successful, rather you should register an ErrorItemListener and check any generated error items to determine
 whether the IDF is suitable for your own purposes.
 
 Calling this method is equivalent to calling parse(idfIn, new IDF());.
 
 IDF files will be parsed in a single threaded manner when calling this form of the parse() method.
 This method blocks until parsing is complete.idfIn - the input stream to use to read IDF data for parsingParseException - if the input stream was unparseablepublic IDF parse(InputStream idfIn, IDF idf) throws ParseException
parse(java.io.InputStream) method that allows callers to specify the IDF object
 they want to be populated.  The IDF returned from this method is in fact a reference to the supplied parameter.
 
 Calling this method is equivalent to calling parse(idfIn, idf, Executors.newSingleThreadExecutor());
 and then blocking until completion.
 
 IDF files will be parsed in a single threaded manner when calling this form of the parse() method.
 This method blocks until parsing is complete.idfIn - the source to read fromidf - the IDF that will be populatedParseException - if the input stream was unparseablepublic IDF parse(InputStream idfIn, IDF idf, ExecutorService service) throws ParseException
parse(java.io.InputStream) method that allows callers to specify both the IDF
 object they wish to be populated and an executor service that should be used to execute all IDF handler tasks.
 
 This method takes an executor service as a parameter, supporting parallel parsing of the IDF.  For parsing a
 single file, this is unlikely to be useful.  By calling parse(java.io.InputStream,
 uk.ac.ebi.arrayexpress2.magetab.datamodel.IDF) operation supplies a single thread to this class.  If parsing
 many IDF files, you may want to tailor this performance to suit your needs. This method does not shutdown the
 executor service on completion, so you can reuse the same service if required. Once all parsing operations
 finish, calling classes are responsible for releasing any resources used.
 
 IDF files will be parsed in a manner appropriate for the supplied ExecutorService when calling this form of the
 parse() method. This method executes asynchronouslyidfIn - the source to read fromidf - the IDF that will be populatedservice - the executor service to use to execute parsing tasksParseException - if the input stream was unparseableprotected void read(String[][] idfData, IDF idf, ExecutorService service) throws ExecutionException, InterruptedException
idfData - the IDF data to handleidf - the IDF into which parsed data should be addedservice - the service to execute handlers withinExecutionException - if any handling tasks failed to executeInterruptedException - if the service was interrupted whilst parsing was ongoingCopyright © 2014. All rights reserved.