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 protectedAbstractPsiXmlSource()Constructor for AbstractPsiXmlSource.protectedAbstractPsiXmlSource(File file)Constructor for AbstractPsiXmlSource.protectedAbstractPsiXmlSource(InputStream input)Constructor for AbstractPsiXmlSource.protectedAbstractPsiXmlSource(Reader reader)Constructor for AbstractPsiXmlSource.protectedAbstractPsiXmlSource(URL url)Constructor for AbstractPsiXmlSource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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 datasourcelonggetNumberOfInteractions()getNumberOfInteractionsvoidreset()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- aFileobject.
-
AbstractPsiXmlSource
protected AbstractPsiXmlSource(InputStream input)
Constructor for AbstractPsiXmlSource.
- Parameters:
input- aInputStreamobject.
-
AbstractPsiXmlSource
protected AbstractPsiXmlSource(Reader reader)
Constructor for AbstractPsiXmlSource.
- Parameters:
reader- aReaderobject.
-
-
Method Detail
-
getInteractions
public Collection<T> getInteractions() throws MIIOException
The collection of Interactions for this datasource- Specified by:
getInteractionsin interfaceInteractionSource<T extends Interaction>- Returns:
- collection of Interactions for this datasource
- Throws:
MIIOException- if any.
-
getNumberOfInteractions
public long getNumberOfInteractions()
getNumberOfInteractions
- Specified by:
getNumberOfInteractionsin interfaceInteractionSource<T extends Interaction>- Returns:
- a long.
-
getInteractionsIterator
public Iterator<T> getInteractionsIterator() throws MIIOException
The iterator of Interactions for this datasource- Specified by:
getInteractionsIteratorin interfaceInteractionStream<T extends Interaction>- Overrides:
getInteractionsIteratorin 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 MIIOExceptionThis method close the file data source and all opened streams and readers- Specified by:
closein interfaceMIDataSource- Overrides:
closein classAbstractPsiXmlStream<T extends Interaction>- Throws:
MIIOException- if the dataSource cannot be closed
-
reset
public void reset() throws MIIOExceptionThis 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:
resetin interfaceMIDataSource- Overrides:
resetin classAbstractPsiXmlStream<T extends Interaction>- Throws:
MIIOException- if the dataSource cannot be reset
-
createXmlIterator
protected Iterator<T> createXmlIterator()
createXmlIterator.
- Specified by:
createXmlIteratorin classAbstractPsiXmlStream<T extends Interaction>- Returns:
- a
Iteratorobject.
-
-