Class AbstractPsiXmlSource<T extends Interaction>
- java.lang.Object
-
- psidev.psi.mi.jami.xml.model.extension.datasource.AbstractPsiXmlStream<T>
-
- psidev.psi.mi.jami.xml.model.extension.datasource.AbstractPsiXmlSource<T>
-
- All Implemented Interfaces:
ErrorHandler
,InteractionSource<T>
,InteractionStream<T>
,MIDataSource
,MIFileDataSource
,MIFileParserListener
,PsiXmlParserListener
,PsiXmlSource<T>
,PsiXmlStreamSource<T>
- Direct Known Subclasses:
AbstractPsiXmlBinarySource
,LightXmlSource
,XmlComplexSource
,XmlEvidenceSource
,XmlModelledSource
,XmlSource
public abstract class AbstractPsiXmlSource<T extends Interaction> extends AbstractPsiXmlStream<T> implements PsiXmlSource<T>
Abstract class for a PSI-XML datasource that loads the full interaction dataset- Since:
08/11/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
-
Fields inherited from class psidev.psi.mi.jami.xml.model.extension.datasource.AbstractPsiXmlStream
SCHEMA_FEATURE, VALIDATION_FEATURE
-
Fields inherited from interface psidev.psi.mi.jami.datasource.MIFileDataSource
FILE_URI_PREFIX, URL_PREFIX_REGEXP
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPsiXmlSource()
Constructor for AbstractPsiXmlSource.protected
AbstractPsiXmlSource(File file)
Constructor for AbstractPsiXmlSource.protected
AbstractPsiXmlSource(InputStream input)
Constructor for AbstractPsiXmlSource.protected
AbstractPsiXmlSource(Reader reader)
Constructor for AbstractPsiXmlSource.protected
AbstractPsiXmlSource(URL url)
Constructor for AbstractPsiXmlSource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
This method close the file data source and all opened streams and readersprotected Iterator<T>
createXmlIterator()
createXmlIterator.Collection<T>
getInteractions()
The collection of Interactions for this datasourceIterator<T>
getInteractionsIterator()
The iterator of Interactions for this datasourcelong
getNumberOfInteractions()
getNumberOfInteractionsvoid
reset()
This method will reset the data sources from all loaded options.-
Methods inherited from class psidev.psi.mi.jami.xml.model.extension.datasource.AbstractPsiXmlStream
error, fatalError, getElementCache, getFileParserListener, getInteractorFactory, getParser, initialiseContext, initialiseExpansionMethod, initialiseXmlParser, initialiseXmlParser, initialiseXmlParser, initialiseXmlParser, isInitialised, onAliasWithoutName, onAnnotationWithoutTopic, onInteractionWithoutParticipants, onInvalidOrganismTaxid, onInvalidPosition, onInvalidRange, onInvalidStoichiometry, onInvalidSyntax, onMissingChecksumMethod, onMissingChecksumValue, onMissingConfidenceType, onMissingConfidenceValue, onMissingCvTermName, onMissingInteractorName, onMissingParameterType, onMissingParameterValue, onParticipantWithoutInteractor, onSeveralExperimentalRolesFound, onSeveralExperimentsFound, onSeveralExpressedInOrganismFound, onSeveralHostOrganismFound, onSyntaxWarning, onUnresolvedReference, onXrefWithoutDatabase, onXrefWithoutId, reInit, setFileParserListener, setInteractorFactory, setMIFileParserListener, setParser, setXmlFileParserListener, validateSyntax, validateSyntax, warning
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xml.sax.ErrorHandler
error, fatalError, warning
-
Methods inherited from interface psidev.psi.mi.jami.datasource.MIDataSource
initialiseContext
-
Methods inherited from interface psidev.psi.mi.jami.datasource.MIFileDataSource
getFileParserListener, setFileParserListener, validateSyntax, validateSyntax
-
Methods inherited from interface psidev.psi.mi.jami.listener.MIFileParserListener
onAliasWithoutName, onAnnotationWithoutTopic, onInteractionWithoutParticipants, onInvalidOrganismTaxid, onInvalidPosition, onInvalidRange, onInvalidStoichiometry, onInvalidSyntax, onMissingChecksumMethod, onMissingChecksumValue, onMissingConfidenceType, onMissingConfidenceValue, onMissingCvTermName, onMissingInteractorName, onMissingParameterType, onMissingParameterValue, onParticipantWithoutInteractor, onSyntaxWarning, onXrefWithoutDatabase, onXrefWithoutId
-
Methods inherited from interface psidev.psi.mi.jami.xml.listener.PsiXmlParserListener
onSeveralExperimentalRolesFound, onSeveralExperimentsFound, onSeveralExpressedInOrganismFound, onSeveralHostOrganismFound, onUnresolvedReference
-
-
-
-
Constructor Detail
-
AbstractPsiXmlSource
protected AbstractPsiXmlSource()
Constructor for AbstractPsiXmlSource.
-
AbstractPsiXmlSource
protected AbstractPsiXmlSource(File file)
Constructor for AbstractPsiXmlSource.
- Parameters:
file
- aFile
object.
-
AbstractPsiXmlSource
protected AbstractPsiXmlSource(InputStream input)
Constructor for AbstractPsiXmlSource.
- Parameters:
input
- aInputStream
object.
-
AbstractPsiXmlSource
protected AbstractPsiXmlSource(Reader reader)
Constructor for AbstractPsiXmlSource.
- Parameters:
reader
- aReader
object.
-
-
Method Detail
-
getInteractions
public Collection<T> getInteractions() throws MIIOException
The collection of Interactions for this datasource- Specified by:
getInteractions
in interfaceInteractionSource<T extends Interaction>
- Returns:
- collection of Interactions for this datasource
- Throws:
MIIOException
- if any.
-
getNumberOfInteractions
public long getNumberOfInteractions()
getNumberOfInteractions
- Specified by:
getNumberOfInteractions
in interfaceInteractionSource<T extends Interaction>
- Returns:
- a long.
-
getInteractionsIterator
public Iterator<T> getInteractionsIterator() throws MIIOException
The iterator of Interactions for this datasource- Specified by:
getInteractionsIterator
in interfaceInteractionStream<T extends Interaction>
- Overrides:
getInteractionsIterator
in classAbstractPsiXmlStream<T extends Interaction>
- Returns:
- iterator of Interactions for this datasource
- Throws:
MIIOException
- exception thrown when it cannot iterate MI data
-
close
public void close() throws MIIOException
This method close the file data source and all opened streams and readers- Specified by:
close
in interfaceMIDataSource
- Overrides:
close
in classAbstractPsiXmlStream<T extends Interaction>
- Throws:
MIIOException
- if the dataSource cannot be closed
-
reset
public void reset() throws MIIOException
This method will reset the data sources from all loaded options. The data source will be back to what is was before the initialiseContext was called. To re-use the data source after calling the reset() method, the data source needs to be re-initialised with initialiseContext. Any provided inputStream or reader will not be closed and will have to be closed separately.- Specified by:
reset
in interfaceMIDataSource
- Overrides:
reset
in classAbstractPsiXmlStream<T extends Interaction>
- Throws:
MIIOException
- if the dataSource cannot be reset
-
createXmlIterator
protected Iterator<T> createXmlIterator()
createXmlIterator.
- Specified by:
createXmlIterator
in classAbstractPsiXmlStream<T extends Interaction>
- Returns:
- a
Iterator
object.
-
-