Class AbstractXmlExperimentWriter
- java.lang.Object
-
- psidev.psi.mi.jami.xml.io.writer.elements.impl.abstracts.AbstractXmlExperimentWriter
-
- All Implemented Interfaces:
PsiXmlElementWriter<Experiment>,PsiXmlExperimentWriter
- Direct Known Subclasses:
XmlExperimentWriter,XmlExperimentWriter
public abstract class AbstractXmlExperimentWriter extends Object implements PsiXmlExperimentWriter
Abstract PSI-XML experiment writer- Since:
12/11/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description AbstractXmlExperimentWriter(PsiXmlVersion version, XMLStreamWriter writer, PsiXmlObjectCache objectIndex)Constructor for AbstractXmlExperimentWriter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CvTermextractDefaultParticipantIdentificationMethod(Experiment exp)extractDefaultParticipantIdentificationMethod.PsiXmlElementWriter<Annotation>getAttributeWriter()Getter for the fieldattributeWriter.PsiXmlElementWriter<Confidence>getConfidenceWriter()Getter for the fieldconfidenceWriter.PublicationgetDefaultPublication()getDefaultPublication.PsiXmlVariableNameWriter<CvTerm>getDetectionMethodWriter()Getter for the fielddetectionMethodWriter.PsiXmlElementWriter<Organism>getHostOrganismWriter()Getter for the fieldhostOrganismWriter.protected PsiXmlObjectCachegetObjectIndex()Getter for the fieldobjectIndex.PsiXmlPublicationWritergetPublicationWriter()Getter for the fieldpublicationWriter.protected XMLStreamWritergetStreamWriter()Getter for the fieldstreamWriter.protected PsiXmlVersiongetVersion()PsiXmlXrefWritergetXrefWriter()Getter for the fieldxrefWriter.protected abstract voidinitialiseConfidenceWriter()initialiseConfidenceWriter.protected voidinitialiseDefaultPublication()initialiseDefaultPublication.protected abstract voidinitialiseDetectionMethodWriter()initialiseDetectionMethodWriter.protected abstract voidinitialiseHostOrganismWriter()initialiseHostOrganismWriter.protected abstract voidinitialisePublicationWriter()initialisePublicationWriter.protected abstract voidinitialiseXrefWriter()initialiseXrefWriter.voidsetAttributeWriter(PsiXmlElementWriter<Annotation> attributeWriter)Setter for the fieldattributeWriter.voidsetConfidenceWriter(PsiXmlElementWriter<Confidence> confidenceWriter)Setter for the fieldconfidenceWriter.voidsetDefaultPublication(Publication pub)Sets the default publication to write in case an experiment does not have a publicationvoidsetDetectionMethodWriter(PsiXmlVariableNameWriter<CvTerm> detectionMethodWriter)Setter for the fielddetectionMethodWriter.voidsetHostOrganismWriter(PsiXmlElementWriter<Organism> hostOrganismWriter)Setter for the fieldhostOrganismWriter.voidsetPublicationWriter(PsiXmlPublicationWriter publicationWriter)Setter for the fieldpublicationWriter.voidsetXrefWriter(PsiXmlXrefWriter xrefWriter)Setter for the fieldxrefWriter.voidwrite(Experiment object)write.protected voidwriteAttributes(Experiment object)writeAttributes.protected voidwriteConfidences(Experiment object)writeConfidences.CvTermwriteExperiment(Experiment object)writeExperiment.protected abstract voidwriteExperimentXrefs(Experiment object, String imexId)writeExperimentXrefs.protected voidwriteHostOrganism(Experiment object)writeHostOrganism.protected voidwriteInteractiondetectionMethod(Experiment object)writeInteractiondetectionMethod.protected voidwriteNames(Experiment object)writeNames.protected abstract voidwriteOtherAttributes(Experiment object, boolean needToWriteAttributeList)writeOtherAttributes.protected voidwriteOtherProperties(Experiment object)writeOtherProperties.protected CvTermwriteParticipantIdentificationMethod(Experiment object)writeParticipantIdentificationMethod.protected voidwritePublicationAndXrefs(Experiment object)writePublicationAndXrefs.protected abstract voidwriteVariableParameters(Experiment object)writeVariableParameters.protected voidwriteXrefFromExperimentXrefs(Experiment object, String imexId)writeXrefFromExperimentXrefs.
-
-
-
Constructor Detail
-
AbstractXmlExperimentWriter
public AbstractXmlExperimentWriter(PsiXmlVersion version, XMLStreamWriter writer, PsiXmlObjectCache objectIndex)
Constructor for AbstractXmlExperimentWriter.
- Parameters:
version- aPsiXmlVersionobject.writer- aXMLStreamWriterobject.objectIndex- aPsiXmlObjectCacheobject.
-
-
Method Detail
-
getPublicationWriter
public PsiXmlPublicationWriter getPublicationWriter()
Getter for the field
publicationWriter.- Returns:
- a
PsiXmlPublicationWriterobject.
-
initialisePublicationWriter
protected abstract void initialisePublicationWriter()
initialisePublicationWriter.
-
setPublicationWriter
public void setPublicationWriter(PsiXmlPublicationWriter publicationWriter)
Setter for the field
publicationWriter.- Parameters:
publicationWriter- aPsiXmlPublicationWriterobject.
-
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.
-
getHostOrganismWriter
public PsiXmlElementWriter<Organism> getHostOrganismWriter()
Getter for the field
hostOrganismWriter.- Returns:
- a
PsiXmlElementWriterobject.
-
initialiseHostOrganismWriter
protected abstract void initialiseHostOrganismWriter()
initialiseHostOrganismWriter.
-
setHostOrganismWriter
public void setHostOrganismWriter(PsiXmlElementWriter<Organism> hostOrganismWriter)
Setter for the field
hostOrganismWriter.- Parameters:
hostOrganismWriter- aPsiXmlElementWriterobject.
-
getDetectionMethodWriter
public PsiXmlVariableNameWriter<CvTerm> getDetectionMethodWriter()
Getter for the field
detectionMethodWriter.- Returns:
- a
PsiXmlVariableNameWriterobject.
-
initialiseDetectionMethodWriter
protected abstract void initialiseDetectionMethodWriter()
initialiseDetectionMethodWriter.
-
setDetectionMethodWriter
public void setDetectionMethodWriter(PsiXmlVariableNameWriter<CvTerm> detectionMethodWriter)
Setter for the field
detectionMethodWriter.- Parameters:
detectionMethodWriter- aPsiXmlVariableNameWriterobject.
-
getAttributeWriter
public PsiXmlElementWriter<Annotation> getAttributeWriter()
Getter for the field
attributeWriter.- Returns:
- a
PsiXmlElementWriterobject.
-
setAttributeWriter
public void setAttributeWriter(PsiXmlElementWriter<Annotation> attributeWriter)
Setter for the field
attributeWriter.- Parameters:
attributeWriter- aPsiXmlElementWriterobject.
-
getConfidenceWriter
public PsiXmlElementWriter<Confidence> getConfidenceWriter()
Getter for the field
confidenceWriter.- Returns:
- a
PsiXmlElementWriterobject.
-
initialiseConfidenceWriter
protected abstract void initialiseConfidenceWriter()
initialiseConfidenceWriter.
-
setConfidenceWriter
public void setConfidenceWriter(PsiXmlElementWriter<Confidence> confidenceWriter)
Setter for the field
confidenceWriter.- Parameters:
confidenceWriter- aPsiXmlElementWriterobject.
-
writeExperiment
public CvTerm writeExperiment(Experiment object) throws MIIOException
writeExperiment.
- Specified by:
writeExperimentin interfacePsiXmlExperimentWriter- Parameters:
object- the experiment to write- Returns:
- the participant identification method used by the writer when writing the experiment. Can be null if no participant identification method has been written.
- Throws:
MIIOException- if any.
-
write
public void write(Experiment object) throws MIIOException
write.
- Specified by:
writein interfacePsiXmlElementWriter<Experiment>- Parameters:
object- a T object.- Throws:
MIIOException- if any.
-
extractDefaultParticipantIdentificationMethod
public CvTerm extractDefaultParticipantIdentificationMethod(Experiment exp)
extractDefaultParticipantIdentificationMethod.
- Specified by:
extractDefaultParticipantIdentificationMethodin interfacePsiXmlExperimentWriter- Parameters:
exp- aExperimentobject.- Returns:
- the default participant identification method associated with this experiment
-
writeParticipantIdentificationMethod
protected CvTerm writeParticipantIdentificationMethod(Experiment object)
writeParticipantIdentificationMethod.
- Parameters:
object- aExperimentobject.- Returns:
- a
CvTermobject.
-
writeVariableParameters
protected abstract void writeVariableParameters(Experiment object) throws XMLStreamException
writeVariableParameters.
- Parameters:
object- aExperimentobject.- Throws:
XMLStreamException- if any.
-
writeOtherProperties
protected void writeOtherProperties(Experiment object) throws XMLStreamException
writeOtherProperties.
- Parameters:
object- aExperimentobject.- Throws:
XMLStreamException- if any.
-
writeConfidences
protected void writeConfidences(Experiment object) throws XMLStreamException
writeConfidences.
- Parameters:
object- aExperimentobject.- Throws:
XMLStreamException- if any.
-
writeAttributes
protected void writeAttributes(Experiment object) throws XMLStreamException
writeAttributes.
- Parameters:
object- aExperimentobject.- Throws:
XMLStreamException- if any.
-
writeOtherAttributes
protected abstract void writeOtherAttributes(Experiment object, boolean needToWriteAttributeList) throws XMLStreamException
writeOtherAttributes.
- Parameters:
object- aExperimentobject.needToWriteAttributeList- a boolean.- Throws:
XMLStreamException- if any.
-
writeInteractiondetectionMethod
protected void writeInteractiondetectionMethod(Experiment object) throws XMLStreamException
writeInteractiondetectionMethod.
- Parameters:
object- aExperimentobject.- Throws:
XMLStreamException- if any.
-
writeHostOrganism
protected void writeHostOrganism(Experiment object) throws XMLStreamException
writeHostOrganism.
- Parameters:
object- aExperimentobject.- Throws:
XMLStreamException- if any.
-
writePublicationAndXrefs
protected void writePublicationAndXrefs(Experiment object) throws XMLStreamException
writePublicationAndXrefs.
- Parameters:
object- aExperimentobject.- Throws:
XMLStreamException- if any.
-
writeExperimentXrefs
protected abstract void writeExperimentXrefs(Experiment object, String imexId) throws XMLStreamException
writeExperimentXrefs.
- Parameters:
object- aExperimentobject.imexId- aStringobject.- Throws:
XMLStreamException- if any.
-
writeXrefFromExperimentXrefs
protected void writeXrefFromExperimentXrefs(Experiment object, String imexId) throws XMLStreamException
writeXrefFromExperimentXrefs.
- Parameters:
object- aExperimentobject.imexId- aStringobject.- Throws:
XMLStreamException- if any.
-
writeNames
protected void writeNames(Experiment object) throws XMLStreamException
writeNames.
- Parameters:
object- aExperimentobject.- 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.
-
getDefaultPublication
public Publication getDefaultPublication()
getDefaultPublication.
- Specified by:
getDefaultPublicationin interfacePsiXmlExperimentWriter- Returns:
- the default publication. It cannot be null
-
setDefaultPublication
public void setDefaultPublication(Publication pub)
Sets the default publication to write in case an experiment does not have a publication- Specified by:
setDefaultPublicationin interfacePsiXmlExperimentWriter- Parameters:
pub- aPublicationobject.
-
initialiseDefaultPublication
protected void initialiseDefaultPublication()
initialiseDefaultPublication.
-
getVersion
protected PsiXmlVersion getVersion()
-
-