gov.nih.nci.caarray.services.fileparse2.parsers
Class MicroarrayTextFileHeaderParser

java.lang.Object
  extended by gov.nih.nci.caarray.services.fileparse2.parsers.BaseMicroarrayFileHeaderParser
      extended by gov.nih.nci.caarray.services.fileparse2.parsers.MicroarrayTextFileHeaderParser
Direct Known Subclasses:
ArrayDesignTextFileHeaderParser

public class MicroarrayTextFileHeaderParser
extends BaseMicroarrayFileHeaderParser

Author:
tranp

Field Summary
protected  java.lang.String headerEndMarkerPattern_
           
 
Fields inherited from class gov.nih.nci.caarray.services.fileparse2.parsers.BaseMicroarrayFileHeaderParser
dataSetMapper_, header_, logger_
 
Constructor Summary
MicroarrayTextFileHeaderParser(DataSetMapper dataSetMapper)
          Constructs a parser to parse a text file's header section.
MicroarrayTextFileHeaderParser(DataSetMapper dataSetMapper, java.lang.String headerEndMarkerPattern)
          Constructs a parser to parse a text file's header section.
 
Method Summary
protected  java.lang.StringBuffer extractHeaderSection(SequenceInputFile inputFile)
           
protected  org.apache.oro.text.regex.MatchResult getMatch()
           
static void main(java.lang.String[] args)
           
protected  boolean match(java.lang.String pattern, java.lang.String input)
           
protected  boolean matchHeaderEndMarkerPattern(java.lang.String text)
           
 void parse(SequenceInputFile inputFile)
           
 boolean validate(SequenceInputFile inputFile, boolean resetPointerAfterDone)
          Validates the file if it's the right one before proceeding further.
 
Methods inherited from class gov.nih.nci.caarray.services.fileparse2.parsers.BaseMicroarrayFileHeaderParser
getDataSetMapper, getHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

headerEndMarkerPattern_

protected java.lang.String headerEndMarkerPattern_
Constructor Detail

MicroarrayTextFileHeaderParser

public MicroarrayTextFileHeaderParser(DataSetMapper dataSetMapper)
Constructs a parser to parse a text file's header section. This constructor assumes the string pattern for detecting where the header section ends is the data table's column header line specified in the specified DataSetMapper.

Parameters:
dataSetMapper -

MicroarrayTextFileHeaderParser

public MicroarrayTextFileHeaderParser(DataSetMapper dataSetMapper,
                                      java.lang.String headerEndMarkerPattern)
Constructs a parser to parse a text file's header section. This constructor uses the specified headerEndMarkerPattern to recognize the end of the header section in the file starting from the top of the file.

Parameters:
dataSetMapper -
headerEndMarkerPattern - - Specifying the pattern of the line at which the file's header section ends.
Method Detail

parse

public void parse(SequenceInputFile inputFile)
           throws java.io.IOException
Specified by:
parse in class BaseMicroarrayFileHeaderParser
Throws:
java.io.IOException

validate

public boolean validate(SequenceInputFile inputFile,
                        boolean resetPointerAfterDone)
                 throws java.io.IOException
Description copied from class: BaseMicroarrayFileHeaderParser
Validates the file if it's the right one before proceeding further. The typical implementation for this is to look at some parameters in the file's header and match certain string. However, anything could be performed to prevent the file from further processing. When this method returns, the file pointer could be repositioned to where it was before the method is invoked so the data can be re-read by passing true for the argument resetPointerAfterDone.

Specified by:
validate in class BaseMicroarrayFileHeaderParser
Returns:
Throws:
java.io.IOException

extractHeaderSection

protected java.lang.StringBuffer extractHeaderSection(SequenceInputFile inputFile)
                                               throws java.io.IOException
Throws:
java.io.IOException

matchHeaderEndMarkerPattern

protected boolean matchHeaderEndMarkerPattern(java.lang.String text)

match

protected boolean match(java.lang.String pattern,
                        java.lang.String input)

getMatch

protected org.apache.oro.text.regex.MatchResult getMatch()

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException