Class AbstractCompactXmlWriter<T extends Interaction>
- java.lang.Object
-
- psidev.psi.mi.jami.xml.io.writer.AbstractXmlWriter<T>
-
- psidev.psi.mi.jami.xml.io.writer.compact.AbstractCompactXmlWriter<T>
-
- All Implemented Interfaces:
InteractionWriter<T>
- Direct Known Subclasses:
AbstractCompactXmlMixWriter
,CompactXmlBinaryEvidenceWriter
,CompactXmlBinaryEvidenceWriter
,CompactXmlComplexWriter
,CompactXmlComplexWriter
,CompactXmlEvidenceWriter
,CompactXmlEvidenceWriter
,CompactXmlModelledBinaryWriter
,CompactXmlModelledBinaryWriter
,CompactXmlModelledWriter
,CompactXmlModelledWriter
,CompactXmlNamedBinaryEvidenceWriter
,CompactXmlNamedEvidenceWriter
,CompactXmlNamedModelledBinaryWriter
,CompactXmlNamedModelledWriter
,LightCompactXmlBinaryWriter
,LightCompactXmlBinaryWriter
,LightCompactXmlNamedBinaryWriter
,LightCompactXmlNamedWriter
,LightCompactXmlWriter
,LightCompactXmlWriter
public abstract class AbstractCompactXmlWriter<T extends Interaction> extends AbstractXmlWriter<T>
Abstract class for Compact XML writers.- Since:
18/11/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type)
Constructor for AbstractCompactXmlWriter.AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type, File file)
Constructor for AbstractCompactXmlWriter.AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type, OutputStream output)
Constructor for AbstractCompactXmlWriter.AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type, Writer writer)
Constructor for AbstractCompactXmlWriter.protected
AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type, XMLStreamWriter streamWriter, PsiXmlObjectCache elementCache)
Constructor for AbstractCompactXmlWriter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
close.protected Set<String>
getAvailabilities()
Getter for the fieldavailabilities
.protected PsiXmlElementWriter<String>
getAvailabilityWriter()
Getter for the fieldavailabilityWriter
.protected Set<Experiment>
getExperiments()
Getter for the fieldexperiments
.protected PsiXmlExperimentWriter
getExperimentWriter()
Getter for the fieldexperimentWriter
.protected Class<T>
getInteractionType()
getInteractionType.protected Set<Interactor>
getInteractors()
Getter for the fieldinteractors
.protected PsiXmlElementWriter<Interactor>
getInteractorWriter()
Getter for the fieldinteractorWriter
.void
initialiseContext(Map<String,Object> options)
Initialise the context of the InteractionWriter given a map of optionsprotected void
initialiseDefaultAvailabilitySet()
initialiseDefaultAvailabilitySet.protected void
initialiseDefaultElementCache()
initialiseDefaultElementCache.protected void
initialiseDefaultExperimentSet()
initialiseDefaultExperimentSet.protected void
initialiseDefaultInteractorSet()
initialiseDefaultInteractorSet.protected void
initialiseOptionalWriters(PsiXmlExperimentWriter experimentWriter, PsiXmlElementWriter<String> availabilityWriter, PsiXmlElementWriter<Interactor> interactorWriter)
initialiseOptionalWriters.protected void
registerAllInteractionsProperties()
registerAllInteractionsProperties.protected void
registerAllInteractors(T interaction)
registerAllInteractors.protected void
registerAllInteractorsAndExperimentsFrom(ModelledInteraction interaction)
registerAllInteractorsAndExperimentsFrom.protected abstract void
registerAvailabilities(T interaction)
registerAvailabilities.protected abstract void
registerExperiment(T interaction)
registerExperiment.protected void
registerInteractionProperties()
registerInteractionProperties.protected void
registerParticipantInteractor(Entity participant)
registerParticipantInteractor.protected void
registerParticipantPoolInteractor(ParticipantPool pool)
registerParticipantPoolInteractor.void
reset()
reset.void
setAvailabilitySet(Set<String> availabilities)
setAvailabilitySet.protected void
setAvailabilityWriter(PsiXmlElementWriter<String> availabilityWriter)
Setter for the fieldavailabilityWriter
.void
setExperimentSet(Set<Experiment> experiments)
setExperimentSet.protected void
setExperimentWriter(PsiXmlExperimentWriter experimentWriter)
Setter for the fieldexperimentWriter
.void
setInteractorSet(Set<Interactor> interactors)
setInteractorSet.protected void
setInteractorWriter(PsiXmlElementWriter<Interactor> interactorWriter)
Setter for the fieldinteractorWriter
.protected void
writeStartEntryContent()
writeStartEntryContent.-
Methods inherited from class psidev.psi.mi.jami.xml.io.writer.AbstractXmlWriter
end, extractSourceFromInteraction, flush, getComplexWriter, getCurrentInteraction, getCurrentSource, getElementCache, getInteractionsIterator, getInteractionWriter, getProcessedInteractions, getStreamWriter, getSubWritersFactory, getVersion, initialiseDefaultInteractionSet, initialiseDefaultSource, initialiseSubWriters, initialiseSubWriters, isStarted, newXmlSource, setAnnotationsWriter, setComplexWriter, setCurrentInteraction, setCurrentSource, setDefaultReleaseDate, setDefaultSource, setElementCache, setEntryAnnotations, setInteractionSet, setInteractionsIterator, setInteractionWriter, setSourceWriter, setStarted, setSubWritersFactory, setVersion, setWriteComplexesAsInteractors, start, write, write, write, writeComplex, writeComplexesAsInteractors, writeEndEntry, writeEndEntryContent, writeEndInteractionList, writeEntryAttributes, writeEntrySetAttributes, writeInteraction, writeInteractionListContent, writeSource, writeStartEntry, writeStartInteractionList, writeSubComplexInEntry
-
-
-
-
Constructor Detail
-
AbstractCompactXmlWriter
public AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type)
Constructor for AbstractCompactXmlWriter.
- Parameters:
version
- aPsiXmlVersion
object.type
- aClass
object.
-
AbstractCompactXmlWriter
public AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type, File file) throws IOException, XMLStreamException
Constructor for AbstractCompactXmlWriter.
- Parameters:
version
- aPsiXmlVersion
object.type
- aClass
object.file
- aFile
object.- Throws:
IOException
- if any.XMLStreamException
- if any.
-
AbstractCompactXmlWriter
public AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type, OutputStream output) throws XMLStreamException
Constructor for AbstractCompactXmlWriter.
- Parameters:
version
- aPsiXmlVersion
object.type
- aClass
object.output
- aOutputStream
object.- Throws:
XMLStreamException
- if any.
-
AbstractCompactXmlWriter
public AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type, Writer writer) throws XMLStreamException
Constructor for AbstractCompactXmlWriter.
- Parameters:
version
- aPsiXmlVersion
object.type
- aClass
object.writer
- aWriter
object.- Throws:
XMLStreamException
- if any.
-
AbstractCompactXmlWriter
protected AbstractCompactXmlWriter(PsiXmlVersion version, Class<T> type, XMLStreamWriter streamWriter, PsiXmlObjectCache elementCache)
Constructor for AbstractCompactXmlWriter.
- Parameters:
version
- aPsiXmlVersion
object.type
- aClass
object.streamWriter
- aXMLStreamWriter
object.elementCache
- aPsiXmlObjectCache
object.
-
-
Method Detail
-
initialiseContext
public void initialiseContext(Map<String,Object> options)
Initialise the context of the InteractionWriter given a map of options- Specified by:
initialiseContext
in interfaceInteractionWriter<T extends Interaction>
- Overrides:
initialiseContext
in classAbstractXmlWriter<T extends Interaction>
- Parameters:
options
- : the options given by the user
-
close
public void close() throws MIIOException
close.
- Specified by:
close
in interfaceInteractionWriter<T extends Interaction>
- Overrides:
close
in classAbstractXmlWriter<T extends Interaction>
- Throws:
MIIOException
- if any.
-
reset
public void reset() throws MIIOException
reset.
- Specified by:
reset
in interfaceInteractionWriter<T extends Interaction>
- Overrides:
reset
in classAbstractXmlWriter<T extends Interaction>
- Throws:
MIIOException
- if any.
-
setExperimentSet
public void setExperimentSet(Set<Experiment> experiments)
setExperimentSet.
- Parameters:
experiments
- aSet
object.
-
setAvailabilitySet
public void setAvailabilitySet(Set<String> availabilities)
setAvailabilitySet.
- Parameters:
availabilities
- aSet
object.
-
setInteractorSet
public void setInteractorSet(Set<Interactor> interactors)
setInteractorSet.
- Parameters:
interactors
- aSet
object.
-
initialiseOptionalWriters
protected void initialiseOptionalWriters(PsiXmlExperimentWriter experimentWriter, PsiXmlElementWriter<String> availabilityWriter, PsiXmlElementWriter<Interactor> interactorWriter)
initialiseOptionalWriters.
- Specified by:
initialiseOptionalWriters
in classAbstractXmlWriter<T extends Interaction>
- Parameters:
experimentWriter
- aPsiXmlExperimentWriter
object.availabilityWriter
- aPsiXmlElementWriter
object.interactorWriter
- aPsiXmlElementWriter
object.
-
registerAllInteractionsProperties
protected void registerAllInteractionsProperties()
registerAllInteractionsProperties.
-
registerAllInteractors
protected void registerAllInteractors(T interaction)
registerAllInteractors.
- Parameters:
interaction
- a T object.
-
registerParticipantPoolInteractor
protected void registerParticipantPoolInteractor(ParticipantPool pool)
registerParticipantPoolInteractor.
- Parameters:
pool
- aParticipantPool
object.
-
registerParticipantInteractor
protected void registerParticipantInteractor(Entity participant)
registerParticipantInteractor.
- Parameters:
participant
- aEntity
object.
-
registerAllInteractorsAndExperimentsFrom
protected void registerAllInteractorsAndExperimentsFrom(ModelledInteraction interaction)
registerAllInteractorsAndExperimentsFrom.
- Parameters:
interaction
- aModelledInteraction
object.
-
registerAvailabilities
protected abstract void registerAvailabilities(T interaction)
registerAvailabilities.
- Parameters:
interaction
- a T object.
-
registerExperiment
protected abstract void registerExperiment(T interaction)
registerExperiment.
- Parameters:
interaction
- a T object.
-
writeStartEntryContent
protected void writeStartEntryContent() throws XMLStreamException
writeStartEntryContent.
- Specified by:
writeStartEntryContent
in classAbstractXmlWriter<T extends Interaction>
- Throws:
XMLStreamException
- if any.
-
getAvailabilityWriter
protected PsiXmlElementWriter<String> getAvailabilityWriter()
Getter for the field
availabilityWriter
.- Returns:
- a
PsiXmlElementWriter
object.
-
setAvailabilityWriter
protected void setAvailabilityWriter(PsiXmlElementWriter<String> availabilityWriter)
Setter for the field
availabilityWriter
.- Parameters:
availabilityWriter
- aPsiXmlElementWriter
object.
-
getExperimentWriter
protected PsiXmlExperimentWriter getExperimentWriter()
Getter for the field
experimentWriter
.- Returns:
- a
PsiXmlExperimentWriter
object.
-
setExperimentWriter
protected void setExperimentWriter(PsiXmlExperimentWriter experimentWriter)
Setter for the field
experimentWriter
.- Parameters:
experimentWriter
- aPsiXmlExperimentWriter
object.
-
getInteractorWriter
protected PsiXmlElementWriter<Interactor> getInteractorWriter()
Getter for the field
interactorWriter
.- Returns:
- a
PsiXmlElementWriter
object.
-
setInteractorWriter
protected void setInteractorWriter(PsiXmlElementWriter<Interactor> interactorWriter)
Setter for the field
interactorWriter
.- Parameters:
interactorWriter
- aPsiXmlElementWriter
object.
-
initialiseDefaultExperimentSet
protected void initialiseDefaultExperimentSet()
initialiseDefaultExperimentSet.
-
initialiseDefaultInteractorSet
protected void initialiseDefaultInteractorSet()
initialiseDefaultInteractorSet.
-
initialiseDefaultAvailabilitySet
protected void initialiseDefaultAvailabilitySet()
initialiseDefaultAvailabilitySet.
-
getExperiments
protected Set<Experiment> getExperiments()
Getter for the field
experiments
.- Returns:
- a
Set
object.
-
getAvailabilities
protected Set<String> getAvailabilities()
Getter for the field
availabilities
.- Returns:
- a
Set
object.
-
getInteractors
protected Set<Interactor> getInteractors()
Getter for the field
interactors
.- Returns:
- a
Set
object.
-
initialiseDefaultElementCache
protected void initialiseDefaultElementCache()
initialiseDefaultElementCache.
- Specified by:
initialiseDefaultElementCache
in classAbstractXmlWriter<T extends Interaction>
-
getInteractionType
protected Class<T> getInteractionType()
getInteractionType.
- Returns:
- a
Class
object.
-
registerInteractionProperties
protected void registerInteractionProperties()
registerInteractionProperties.
-
-