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.ExperimentextractDefaultExperimentFrom(T interaction)extractDefaultExperimentFrom.PsiXmlElementWriter<Annotation>getAttributeWriter()Getter for the fieldattributeWriter.PsiXmlElementWriter<Checksum>getChecksumWriter()Getter for the fieldchecksumWriter.ExperimentgetDefaultExperiment()Getter for the fielddefaultExperiment.PsiXmlExperimentWritergetExperimentWriter()Getter for the fieldexperimentWriter.PsiXmlElementWriter<Set<Feature>>getInferredInteractionWriter()Getter for the fieldinferredInteractionWriter.PsiXmlVariableNameWriter<CvTerm>getInteractionTypeWriter()Getter for the fieldinteractionTypeWriter.protected PsiXmlObjectCachegetObjectIndex()Getter for the fieldobjectIndex.PsiXmlParticipantWriter<P>getParticipantWriter()Getter for the fieldparticipantWriter.protected XMLStreamWritergetStreamWriter()Getter for the fieldstreamWriter.protected PsiXmlVersiongetVersion()PsiXmlXrefWritergetXrefWriter()Getter for the fieldxrefWriter.protected voidinitialiseDefaultExperiment()initialiseDefaultExperiment.protected abstract voidinitialiseExperimentWriter()initialiseExperimentWriter.protected abstract voidinitialiseInferredInteractionWriter()initialiseInferredInteractionWriter.protected abstract voidinitialiseInteractionTypeWriter()initialiseInteractionTypeWriter.protected abstract voidinitialiseParticipantWriter()initialiseParticipantWriter.protected abstract voidinitialiseXrefWriter()initialiseXrefWriter.protected ExtendedPsiXmlExperimentnewExperiment(Publication publication)protected PublicationnewPublication(String pubmed)protected PublicationnewPublication(String title, String journal, Date publicationDate)protected CvTermnewXmlCvTerm(String shortName, CvTerm database, String id, CvTerm qualifier)voidsetAttributeWriter(PsiXmlElementWriter<Annotation> attributeWriter)Setter for the fieldattributeWriter.voidsetChecksumWriter(PsiXmlElementWriter<Checksum> checksumWriter)Setter for the fieldchecksumWriter.voidsetComplexAsInteractor(boolean complexAsInteractor)Sets the property of the writer to write a complex as an interactor or as an interactionvoidsetDefaultExperiment(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 experimentvoidsetExperimentWriter(PsiXmlExperimentWriter experimentWriter)Setter for the fieldexperimentWriter.voidsetInferredInteractionWriter(PsiXmlElementWriter<Set<Feature>> inferredInteractionWriter)Setter for the fieldinferredInteractionWriter.voidsetInteractionTypeWriter(PsiXmlVariableNameWriter<CvTerm> interactionTypeWriter)Setter for the fieldinteractionTypeWriter.voidsetParticipantWriter(PsiXmlParticipantWriter<P> participantWriter)Setter for the fieldparticipantWriter.voidsetXrefWriter(PsiXmlXrefWriter xrefWriter)Setter for the fieldxrefWriter.voidwrite(T object)write.protected voidwriteAttribute(String name, String nameAc)writeAttribute.protected voidwriteAttributes(T object)writeAttributes.protected abstract voidwriteAvailability(T object)writeAvailability.booleanwriteComplexAsInteractor()writeComplexAsInteractor.protected abstract voidwriteConfidences(T object)writeConfidences.protected CvTermwriteExperimentDescription()writeExperimentDescription.protected CvTermwriteExperimentRef()writeExperimentRef.protected abstract CvTermwriteExperiments(T object)writeExperiments.protected abstract voidwriteInferredInteractions(T object)writeInferredInteractions.protected voidwriteInteractionType(T object)writeInteractionType.protected voidwriteIntraMolecular(T object)writeIntraMolecular.protected abstract voidwriteModelled(T object)writeModelled.protected voidwriteNames(T object)writeNames.protected abstract voidwriteNegative(T object)writeNegative.protected abstract voidwriteOtherAttributes(T object)writeOtherAttributes.protected abstract voidwriteOtherProperties(T object)writeOtherProperties.protected abstract voidwriteParameters(T object)writeParameters.protected voidwriteParticipants(T object, CvTerm method)writeParticipants.protected abstract voidwriteStartInteraction()writeStartInteraction.protected voidwriteXref(T object)writeXref.protected voidwriteXrefFromInteractionIdentifiers(T object)writeXrefFromInteractionIdentifiers.protected voidwriteXrefFromInteractionXrefs(T object)writeXrefFromInteractionXrefs.
-
-
-
Constructor Detail
-
AbstractXmlInteractionWriter
public AbstractXmlInteractionWriter(PsiXmlVersion version, XMLStreamWriter writer, PsiXmlObjectCache objectIndex)
Constructor for AbstractXmlInteractionWriter.
- Parameters:
version- aPsiXmlVersionobject.writer- aXMLStreamWriterobject.objectIndex- aPsiXmlObjectCacheobject.
-
-
Method Detail
-
getParticipantWriter
public PsiXmlParticipantWriter<P> getParticipantWriter()
Getter for the field
participantWriter.- Returns:
- a
PsiXmlParticipantWriterobject.
-
initialiseParticipantWriter
protected abstract void initialiseParticipantWriter()
initialiseParticipantWriter.
-
setParticipantWriter
public void setParticipantWriter(PsiXmlParticipantWriter<P> participantWriter)
Setter for the field
participantWriter.- Parameters:
participantWriter- aPsiXmlParticipantWriterobject.
-
getXrefWriter
public PsiXmlXrefWriter getXrefWriter()
Getter for the field
xrefWriter.- Returns:
- a
PsiXmlXrefWriterobject.
-
initialiseXrefWriter
protected abstract void initialiseXrefWriter()
initialiseXrefWriter.
-
setXrefWriter
public void setXrefWriter(PsiXmlXrefWriter xrefWriter)
Setter for the field
xrefWriter.- Parameters:
xrefWriter- aPsiXmlXrefWriterobject.
-
setInteractionTypeWriter
public void setInteractionTypeWriter(PsiXmlVariableNameWriter<CvTerm> interactionTypeWriter)
Setter for the field
interactionTypeWriter.- Parameters:
interactionTypeWriter- aPsiXmlVariableNameWriterobject.
-
setAttributeWriter
public void setAttributeWriter(PsiXmlElementWriter<Annotation> attributeWriter)
Setter for the field
attributeWriter.- Parameters:
attributeWriter- aPsiXmlElementWriterobject.
-
getInferredInteractionWriter
public PsiXmlElementWriter<Set<Feature>> getInferredInteractionWriter()
Getter for the field
inferredInteractionWriter.- Returns:
- a
PsiXmlElementWriterobject.
-
initialiseInferredInteractionWriter
protected abstract void initialiseInferredInteractionWriter()
initialiseInferredInteractionWriter.
-
setInferredInteractionWriter
public void setInferredInteractionWriter(PsiXmlElementWriter<Set<Feature>> inferredInteractionWriter)
Setter for the field
inferredInteractionWriter.- Parameters:
inferredInteractionWriter- aPsiXmlElementWriterobject.
-
setExperimentWriter
public void setExperimentWriter(PsiXmlExperimentWriter experimentWriter)
Setter for the field
experimentWriter.- Parameters:
experimentWriter- aPsiXmlExperimentWriterobject.
-
setChecksumWriter
public void setChecksumWriter(PsiXmlElementWriter<Checksum> checksumWriter)
Setter for the field
checksumWriter.- Parameters:
checksumWriter- aPsiXmlElementWriterobject.
-
getExperimentWriter
public PsiXmlExperimentWriter getExperimentWriter()
Getter for the field
experimentWriter.- Returns:
- a
PsiXmlExperimentWriterobject.
-
initialiseExperimentWriter
protected abstract void initialiseExperimentWriter()
initialiseExperimentWriter.
-
getChecksumWriter
public PsiXmlElementWriter<Checksum> getChecksumWriter()
Getter for the field
checksumWriter.- Returns:
- a
PsiXmlElementWriterobject.
-
getInteractionTypeWriter
public PsiXmlVariableNameWriter<CvTerm> getInteractionTypeWriter()
Getter for the field
interactionTypeWriter.- Returns:
- a
PsiXmlVariableNameWriterobject.
-
initialiseInteractionTypeWriter
protected abstract void initialiseInteractionTypeWriter()
initialiseInteractionTypeWriter.
-
getAttributeWriter
public PsiXmlElementWriter<Annotation> getAttributeWriter()
Getter for the field
attributeWriter.- Returns:
- a
PsiXmlElementWriterobject.
-
write
public void write(T object) throws MIIOException
write.
- Specified by:
writein 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 XMLStreamExceptionwriteStartInteraction.
- Throws:
XMLStreamException- if any.
-
getDefaultExperiment
public Experiment getDefaultExperiment()
Getter for the field
defaultExperiment.- Specified by:
getDefaultExperimentin interfacePsiXmlInteractionWriter<T extends Interaction>- Returns:
- a
Experimentobject.
-
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:
setDefaultExperimentin interfacePsiXmlInteractionWriter<T extends Interaction>- Parameters:
defaultExperiment- : default experiment
-
extractDefaultExperimentFrom
public Experiment extractDefaultExperimentFrom(T interaction)
extractDefaultExperimentFrom.
- Specified by:
extractDefaultExperimentFromin interfacePsiXmlInteractionWriter<T extends Interaction>- Parameters:
interaction- a T object.- Returns:
- the default experiment for this interaction
-
writeComplexAsInteractor
public boolean writeComplexAsInteractor()
writeComplexAsInteractor.
- Specified by:
writeComplexAsInteractorin 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:
setComplexAsInteractorin 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- aCvTermobject.- 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
CvTermobject. - 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
XMLStreamWriterobject.
-
getObjectIndex
protected PsiXmlObjectCache getObjectIndex()
Getter for the field
objectIndex.- Returns:
- a
PsiXmlObjectCacheobject.
-
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
CvTermobject. - Throws:
XMLStreamException- if any.
-
writeExperimentDescription
protected CvTerm writeExperimentDescription() throws XMLStreamException
writeExperimentDescription.
- Returns:
- a
CvTermobject. - Throws:
XMLStreamException- if any.
-
initialiseDefaultExperiment
protected void initialiseDefaultExperiment()
initialiseDefaultExperiment.
-
writeAttribute
protected void writeAttribute(String name, String nameAc) throws XMLStreamException
writeAttribute.
- Parameters:
name- aStringobject.nameAc- aStringobject.- Throws:
XMLStreamException- if any.
-
collectInferredInteractionsFrom
protected Collection<Set<Feature>> collectInferredInteractionsFrom(T object)
collectInferredInteractionsFrom.
- Parameters:
object- a T object.- Returns:
- a
Collectionobject.
-
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)
-
-