Class AbstractXmlInteractionWriter<T extends Interaction,P extends Participant>
- java.lang.Object
-
- psidev.psi.mi.jami.xml.io.writer.elements.impl.abstracts.AbstractXmlInteractionWriter<T,P>
-
- All Implemented Interfaces:
PsiXmlElementWriter<T>
,PsiXmlInteractionWriter<T>
- Direct Known Subclasses:
AbstractXmlInteractionEvidenceWriter
,AbstractXmlInteractionWriter
,AbstractXmlModelledInteractionWriter
public abstract class AbstractXmlInteractionWriter<T extends Interaction,P extends Participant> extends Object implements PsiXmlInteractionWriter<T>
Abstract writer of interaction- Since:
12/11/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description AbstractXmlInteractionWriter(PsiXmlVersion version, XMLStreamWriter writer, PsiXmlObjectCache objectIndex)
Constructor for AbstractXmlInteractionWriter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Collection<Set<Feature>>
collectInferredInteractionsFrom(T object)
collectInferredInteractionsFrom.Experiment
extractDefaultExperimentFrom(T interaction)
extractDefaultExperimentFrom.PsiXmlElementWriter<Annotation>
getAttributeWriter()
Getter for the fieldattributeWriter
.PsiXmlElementWriter<Checksum>
getChecksumWriter()
Getter for the fieldchecksumWriter
.Experiment
getDefaultExperiment()
Getter for the fielddefaultExperiment
.PsiXmlExperimentWriter
getExperimentWriter()
Getter for the fieldexperimentWriter
.PsiXmlElementWriter<Set<Feature>>
getInferredInteractionWriter()
Getter for the fieldinferredInteractionWriter
.PsiXmlVariableNameWriter<CvTerm>
getInteractionTypeWriter()
Getter for the fieldinteractionTypeWriter
.protected PsiXmlObjectCache
getObjectIndex()
Getter for the fieldobjectIndex
.PsiXmlParticipantWriter<P>
getParticipantWriter()
Getter for the fieldparticipantWriter
.protected XMLStreamWriter
getStreamWriter()
Getter for the fieldstreamWriter
.protected PsiXmlVersion
getVersion()
PsiXmlXrefWriter
getXrefWriter()
Getter for the fieldxrefWriter
.protected void
initialiseDefaultExperiment()
initialiseDefaultExperiment.protected abstract void
initialiseExperimentWriter()
initialiseExperimentWriter.protected abstract void
initialiseInferredInteractionWriter()
initialiseInferredInteractionWriter.protected abstract void
initialiseInteractionTypeWriter()
initialiseInteractionTypeWriter.protected abstract void
initialiseParticipantWriter()
initialiseParticipantWriter.protected abstract void
initialiseXrefWriter()
initialiseXrefWriter.protected ExtendedPsiXmlExperiment
newExperiment(Publication publication)
protected Publication
newPublication(String pubmed)
protected Publication
newPublication(String title, String journal, Date publicationDate)
protected CvTerm
newXmlCvTerm(String shortName, CvTerm database, String id, CvTerm qualifier)
void
setAttributeWriter(PsiXmlElementWriter<Annotation> attributeWriter)
Setter for the fieldattributeWriter
.void
setChecksumWriter(PsiXmlElementWriter<Checksum> checksumWriter)
Setter for the fieldchecksumWriter
.void
setComplexAsInteractor(boolean complexAsInteractor)
Sets the property of the writer to write a complex as an interactor or as an interactionvoid
setDefaultExperiment(Experiment defaultExperiment)
Sets the default experiment that will be used to write a valid XML file even if the interaction does not have any valid experimentvoid
setExperimentWriter(PsiXmlExperimentWriter experimentWriter)
Setter for the fieldexperimentWriter
.void
setInferredInteractionWriter(PsiXmlElementWriter<Set<Feature>> inferredInteractionWriter)
Setter for the fieldinferredInteractionWriter
.void
setInteractionTypeWriter(PsiXmlVariableNameWriter<CvTerm> interactionTypeWriter)
Setter for the fieldinteractionTypeWriter
.void
setParticipantWriter(PsiXmlParticipantWriter<P> participantWriter)
Setter for the fieldparticipantWriter
.void
setXrefWriter(PsiXmlXrefWriter xrefWriter)
Setter for the fieldxrefWriter
.void
write(T object)
write.protected void
writeAttribute(String name, String nameAc)
writeAttribute.protected void
writeAttributes(T object)
writeAttributes.protected abstract void
writeAvailability(T object)
writeAvailability.boolean
writeComplexAsInteractor()
writeComplexAsInteractor.protected abstract void
writeConfidences(T object)
writeConfidences.protected CvTerm
writeExperimentDescription()
writeExperimentDescription.protected CvTerm
writeExperimentRef()
writeExperimentRef.protected abstract CvTerm
writeExperiments(T object)
writeExperiments.protected abstract void
writeInferredInteractions(T object)
writeInferredInteractions.protected void
writeInteractionType(T object)
writeInteractionType.protected void
writeIntraMolecular(T object)
writeIntraMolecular.protected abstract void
writeModelled(T object)
writeModelled.protected void
writeNames(T object)
writeNames.protected abstract void
writeNegative(T object)
writeNegative.protected abstract void
writeOtherAttributes(T object)
writeOtherAttributes.protected abstract void
writeOtherProperties(T object)
writeOtherProperties.protected abstract void
writeParameters(T object)
writeParameters.protected void
writeParticipants(T object, CvTerm method)
writeParticipants.protected abstract void
writeStartInteraction()
writeStartInteraction.protected void
writeXref(T object)
writeXref.protected void
writeXrefFromInteractionIdentifiers(T object)
writeXrefFromInteractionIdentifiers.protected void
writeXrefFromInteractionXrefs(T object)
writeXrefFromInteractionXrefs.
-
-
-
Constructor Detail
-
AbstractXmlInteractionWriter
public AbstractXmlInteractionWriter(PsiXmlVersion version, XMLStreamWriter writer, PsiXmlObjectCache objectIndex)
Constructor for AbstractXmlInteractionWriter.
- Parameters:
version
- aPsiXmlVersion
object.writer
- aXMLStreamWriter
object.objectIndex
- aPsiXmlObjectCache
object.
-
-
Method Detail
-
getParticipantWriter
public PsiXmlParticipantWriter<P> getParticipantWriter()
Getter for the field
participantWriter
.- Returns:
- a
PsiXmlParticipantWriter
object.
-
initialiseParticipantWriter
protected abstract void initialiseParticipantWriter()
initialiseParticipantWriter.
-
setParticipantWriter
public void setParticipantWriter(PsiXmlParticipantWriter<P> participantWriter)
Setter for the field
participantWriter
.- Parameters:
participantWriter
- aPsiXmlParticipantWriter
object.
-
getXrefWriter
public PsiXmlXrefWriter getXrefWriter()
Getter for the field
xrefWriter
.- Returns:
- a
PsiXmlXrefWriter
object.
-
initialiseXrefWriter
protected abstract void initialiseXrefWriter()
initialiseXrefWriter.
-
setXrefWriter
public void setXrefWriter(PsiXmlXrefWriter xrefWriter)
Setter for the field
xrefWriter
.- Parameters:
xrefWriter
- aPsiXmlXrefWriter
object.
-
setInteractionTypeWriter
public void setInteractionTypeWriter(PsiXmlVariableNameWriter<CvTerm> interactionTypeWriter)
Setter for the field
interactionTypeWriter
.- Parameters:
interactionTypeWriter
- aPsiXmlVariableNameWriter
object.
-
setAttributeWriter
public void setAttributeWriter(PsiXmlElementWriter<Annotation> attributeWriter)
Setter for the field
attributeWriter
.- Parameters:
attributeWriter
- aPsiXmlElementWriter
object.
-
getInferredInteractionWriter
public PsiXmlElementWriter<Set<Feature>> getInferredInteractionWriter()
Getter for the field
inferredInteractionWriter
.- Returns:
- a
PsiXmlElementWriter
object.
-
initialiseInferredInteractionWriter
protected abstract void initialiseInferredInteractionWriter()
initialiseInferredInteractionWriter.
-
setInferredInteractionWriter
public void setInferredInteractionWriter(PsiXmlElementWriter<Set<Feature>> inferredInteractionWriter)
Setter for the field
inferredInteractionWriter
.- Parameters:
inferredInteractionWriter
- aPsiXmlElementWriter
object.
-
setExperimentWriter
public void setExperimentWriter(PsiXmlExperimentWriter experimentWriter)
Setter for the field
experimentWriter
.- Parameters:
experimentWriter
- aPsiXmlExperimentWriter
object.
-
setChecksumWriter
public void setChecksumWriter(PsiXmlElementWriter<Checksum> checksumWriter)
Setter for the field
checksumWriter
.- Parameters:
checksumWriter
- aPsiXmlElementWriter
object.
-
getExperimentWriter
public PsiXmlExperimentWriter getExperimentWriter()
Getter for the field
experimentWriter
.- Returns:
- a
PsiXmlExperimentWriter
object.
-
initialiseExperimentWriter
protected abstract void initialiseExperimentWriter()
initialiseExperimentWriter.
-
getChecksumWriter
public PsiXmlElementWriter<Checksum> getChecksumWriter()
Getter for the field
checksumWriter
.- Returns:
- a
PsiXmlElementWriter
object.
-
getInteractionTypeWriter
public PsiXmlVariableNameWriter<CvTerm> getInteractionTypeWriter()
Getter for the field
interactionTypeWriter
.- Returns:
- a
PsiXmlVariableNameWriter
object.
-
initialiseInteractionTypeWriter
protected abstract void initialiseInteractionTypeWriter()
initialiseInteractionTypeWriter.
-
getAttributeWriter
public PsiXmlElementWriter<Annotation> getAttributeWriter()
Getter for the field
attributeWriter
.- Returns:
- a
PsiXmlElementWriter
object.
-
write
public void write(T object) throws MIIOException
write.
- Specified by:
write
in interfacePsiXmlElementWriter<T extends Interaction>
- Parameters:
object
- a T object.- Throws:
MIIOException
- if any.
-
writeOtherProperties
protected abstract void writeOtherProperties(T object) throws XMLStreamException
writeOtherProperties.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeStartInteraction
protected abstract void writeStartInteraction() throws XMLStreamException
writeStartInteraction.
- Throws:
XMLStreamException
- if any.
-
getDefaultExperiment
public Experiment getDefaultExperiment()
Getter for the field
defaultExperiment
.- Specified by:
getDefaultExperiment
in interfacePsiXmlInteractionWriter<T extends Interaction>
- Returns:
- a
Experiment
object.
-
setDefaultExperiment
public void setDefaultExperiment(Experiment defaultExperiment)
Sets the default experiment that will be used to write a valid XML file even if the interaction does not have any valid experiment- Specified by:
setDefaultExperiment
in interfacePsiXmlInteractionWriter<T extends Interaction>
- Parameters:
defaultExperiment
- : default experiment
-
extractDefaultExperimentFrom
public Experiment extractDefaultExperimentFrom(T interaction)
extractDefaultExperimentFrom.
- Specified by:
extractDefaultExperimentFrom
in interfacePsiXmlInteractionWriter<T extends Interaction>
- Parameters:
interaction
- a T object.- Returns:
- the default experiment for this interaction
-
writeComplexAsInteractor
public boolean writeComplexAsInteractor()
writeComplexAsInteractor.
- Specified by:
writeComplexAsInteractor
in interfacePsiXmlInteractionWriter<T extends Interaction>
- Returns:
- true if the participant writer will write a complex as an interactor
-
setComplexAsInteractor
public void setComplexAsInteractor(boolean complexAsInteractor)
Sets the property of the writer to write a complex as an interactor or as an interaction- Specified by:
setComplexAsInteractor
in interfacePsiXmlInteractionWriter<T extends Interaction>
- Parameters:
complexAsInteractor
- a boolean.
-
writeAttributes
protected void writeAttributes(T object) throws XMLStreamException
writeAttributes.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeInteractionType
protected void writeInteractionType(T object) throws XMLStreamException
writeInteractionType.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeInferredInteractions
protected abstract void writeInferredInteractions(T object) throws XMLStreamException
writeInferredInteractions.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeParticipants
protected void writeParticipants(T object, CvTerm method) throws XMLStreamException
writeParticipants.
- Parameters:
object
- a T object.method
- aCvTerm
object.- Throws:
XMLStreamException
- if any.
-
writeNames
protected void writeNames(T object) throws XMLStreamException
writeNames.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeAvailability
protected abstract void writeAvailability(T object) throws XMLStreamException
writeAvailability.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeExperiments
protected abstract CvTerm writeExperiments(T object) throws XMLStreamException
writeExperiments.
- Parameters:
object
- a T object.- Returns:
- a
CvTerm
object. - Throws:
XMLStreamException
- if any.
-
writeOtherAttributes
protected abstract void writeOtherAttributes(T object) throws XMLStreamException
writeOtherAttributes.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeIntraMolecular
protected void writeIntraMolecular(T object) throws XMLStreamException
writeIntraMolecular.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeModelled
protected abstract void writeModelled(T object) throws XMLStreamException
writeModelled.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeXref
protected void writeXref(T object) throws XMLStreamException
writeXref.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeXrefFromInteractionXrefs
protected void writeXrefFromInteractionXrefs(T object) throws XMLStreamException
writeXrefFromInteractionXrefs.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeXrefFromInteractionIdentifiers
protected void writeXrefFromInteractionIdentifiers(T object) throws XMLStreamException
writeXrefFromInteractionIdentifiers.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
getStreamWriter
protected XMLStreamWriter getStreamWriter()
Getter for the field
streamWriter
.- Returns:
- a
XMLStreamWriter
object.
-
getObjectIndex
protected PsiXmlObjectCache getObjectIndex()
Getter for the field
objectIndex
.- Returns:
- a
PsiXmlObjectCache
object.
-
writeParameters
protected abstract void writeParameters(T object) throws XMLStreamException
writeParameters.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeConfidences
protected abstract void writeConfidences(T object) throws XMLStreamException
writeConfidences.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeNegative
protected abstract void writeNegative(T object) throws XMLStreamException
writeNegative.
- Parameters:
object
- a T object.- Throws:
XMLStreamException
- if any.
-
writeExperimentRef
protected CvTerm writeExperimentRef() throws XMLStreamException
writeExperimentRef.
- Returns:
- a
CvTerm
object. - Throws:
XMLStreamException
- if any.
-
writeExperimentDescription
protected CvTerm writeExperimentDescription() throws XMLStreamException
writeExperimentDescription.
- Returns:
- a
CvTerm
object. - Throws:
XMLStreamException
- if any.
-
initialiseDefaultExperiment
protected void initialiseDefaultExperiment()
initialiseDefaultExperiment.
-
writeAttribute
protected void writeAttribute(String name, String nameAc) throws XMLStreamException
writeAttribute.
- Parameters:
name
- aString
object.nameAc
- aString
object.- Throws:
XMLStreamException
- if any.
-
collectInferredInteractionsFrom
protected Collection<Set<Feature>> collectInferredInteractionsFrom(T object)
collectInferredInteractionsFrom.
- Parameters:
object
- a T object.- Returns:
- a
Collection
object.
-
getVersion
protected PsiXmlVersion getVersion()
-
newExperiment
protected ExtendedPsiXmlExperiment newExperiment(Publication publication)
-
newPublication
protected Publication newPublication(String title, String journal, Date publicationDate)
-
newPublication
protected Publication newPublication(String pubmed)
-
-