Class RecordParser<T>
java.lang.Object
ubic.gemma.core.loader.util.parser.RecordParser<T>
- All Implemented Interfaces:
Parser<T>
- Direct Known Subclasses:
FastaParser,SwissProtParser
Abstract record-based parser. Records are defined by lines starting with a given record separator. The default record
separator is ">".
- Author:
- pavlidis
-
Field Summary
FieldsFields inherited from interface ubic.gemma.core.loader.util.parser.Parser
PARSE_ALERT_FREQUENCY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidAdd an object to the results collection.abstract Collection<T> voidParse aFilevoidparse(InputStream is) Parse aInputStream.voidParse a file identified by its path.protected abstract ObjectparseOneRecord(String record) Handle the parsing of a single record from the input.voidsetRecordSeparator(String recordSeparator) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ubic.gemma.core.loader.util.parser.Parser
getUniqueResult
-
Field Details
-
log
protected static final org.apache.commons.logging.Log log
-
-
Constructor Details
-
RecordParser
public RecordParser()
-
-
Method Details
-
getResults
- Specified by:
getResultsin interfaceParser<T>- Returns:
- the results of the parse.
-
parse
Description copied from interface:ParserParse aFile- Specified by:
parsein interfaceParser<T>- Parameters:
file- file- Throws:
IOException- if there is a problem while manipulating the file
-
parse
Description copied from interface:ParserParse aInputStream.- Specified by:
parsein interfaceParser<T>- Parameters:
is- input stream- Throws:
IOException- if there is a problem while manipulating the file
-
parse
Description copied from interface:ParserParse a file identified by its path.- Specified by:
parsein interfaceParser<T>- Parameters:
filename- Absolute path to the file- Throws:
IOException- if there is a problem while manipulating the file
-
setRecordSeparator
-
parseOneRecord
Handle the parsing of a single record from the input.- Parameters:
record- record- Returns:
- parsed object
-
addResult
Add an object to the results collection.- Parameters:
obj- object
-