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 CvTerm
extractDefaultParticipantIdentificationMethod(Experiment exp)
extractDefaultParticipantIdentificationMethod.PsiXmlElementWriter<Annotation>
getAttributeWriter()
Getter for the fieldattributeWriter
.PsiXmlElementWriter<Confidence>
getConfidenceWriter()
Getter for the fieldconfidenceWriter
.Publication
getDefaultPublication()
getDefaultPublication.PsiXmlVariableNameWriter<CvTerm>
getDetectionMethodWriter()
Getter for the fielddetectionMethodWriter
.PsiXmlElementWriter<Organism>
getHostOrganismWriter()
Getter for the fieldhostOrganismWriter
.protected PsiXmlObjectCache
getObjectIndex()
Getter for the fieldobjectIndex
.PsiXmlPublicationWriter
getPublicationWriter()
Getter for the fieldpublicationWriter
.protected XMLStreamWriter
getStreamWriter()
Getter for the fieldstreamWriter
.protected PsiXmlVersion
getVersion()
PsiXmlXrefWriter
getXrefWriter()
Getter for the fieldxrefWriter
.protected abstract void
initialiseConfidenceWriter()
initialiseConfidenceWriter.protected void
initialiseDefaultPublication()
initialiseDefaultPublication.protected abstract void
initialiseDetectionMethodWriter()
initialiseDetectionMethodWriter.protected abstract void
initialiseHostOrganismWriter()
initialiseHostOrganismWriter.protected abstract void
initialisePublicationWriter()
initialisePublicationWriter.protected abstract void
initialiseXrefWriter()
initialiseXrefWriter.void
setAttributeWriter(PsiXmlElementWriter<Annotation> attributeWriter)
Setter for the fieldattributeWriter
.void
setConfidenceWriter(PsiXmlElementWriter<Confidence> confidenceWriter)
Setter for the fieldconfidenceWriter
.void
setDefaultPublication(Publication pub)
Sets the default publication to write in case an experiment does not have a publicationvoid
setDetectionMethodWriter(PsiXmlVariableNameWriter<CvTerm> detectionMethodWriter)
Setter for the fielddetectionMethodWriter
.void
setHostOrganismWriter(PsiXmlElementWriter<Organism> hostOrganismWriter)
Setter for the fieldhostOrganismWriter
.void
setPublicationWriter(PsiXmlPublicationWriter publicationWriter)
Setter for the fieldpublicationWriter
.void
setXrefWriter(PsiXmlXrefWriter xrefWriter)
Setter for the fieldxrefWriter
.void
write(Experiment object)
write.protected void
writeAttributes(Experiment object)
writeAttributes.protected void
writeConfidences(Experiment object)
writeConfidences.CvTerm
writeExperiment(Experiment object)
writeExperiment.protected abstract void
writeExperimentXrefs(Experiment object, String imexId)
writeExperimentXrefs.protected void
writeHostOrganism(Experiment object)
writeHostOrganism.protected void
writeInteractiondetectionMethod(Experiment object)
writeInteractiondetectionMethod.protected void
writeNames(Experiment object)
writeNames.protected abstract void
writeOtherAttributes(Experiment object, boolean needToWriteAttributeList)
writeOtherAttributes.protected void
writeOtherProperties(Experiment object)
writeOtherProperties.protected CvTerm
writeParticipantIdentificationMethod(Experiment object)
writeParticipantIdentificationMethod.protected void
writePublicationAndXrefs(Experiment object)
writePublicationAndXrefs.protected abstract void
writeVariableParameters(Experiment object)
writeVariableParameters.protected void
writeXrefFromExperimentXrefs(Experiment object, String imexId)
writeXrefFromExperimentXrefs.
-
-
-
Constructor Detail
-
AbstractXmlExperimentWriter
public AbstractXmlExperimentWriter(PsiXmlVersion version, XMLStreamWriter writer, PsiXmlObjectCache objectIndex)
Constructor for AbstractXmlExperimentWriter.
- Parameters:
version
- aPsiXmlVersion
object.writer
- aXMLStreamWriter
object.objectIndex
- aPsiXmlObjectCache
object.
-
-
Method Detail
-
getPublicationWriter
public PsiXmlPublicationWriter getPublicationWriter()
Getter for the field
publicationWriter
.- Returns:
- a
PsiXmlPublicationWriter
object.
-
initialisePublicationWriter
protected abstract void initialisePublicationWriter()
initialisePublicationWriter.
-
setPublicationWriter
public void setPublicationWriter(PsiXmlPublicationWriter publicationWriter)
Setter for the field
publicationWriter
.- Parameters:
publicationWriter
- aPsiXmlPublicationWriter
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.
-
getHostOrganismWriter
public PsiXmlElementWriter<Organism> getHostOrganismWriter()
Getter for the field
hostOrganismWriter
.- Returns:
- a
PsiXmlElementWriter
object.
-
initialiseHostOrganismWriter
protected abstract void initialiseHostOrganismWriter()
initialiseHostOrganismWriter.
-
setHostOrganismWriter
public void setHostOrganismWriter(PsiXmlElementWriter<Organism> hostOrganismWriter)
Setter for the field
hostOrganismWriter
.- Parameters:
hostOrganismWriter
- aPsiXmlElementWriter
object.
-
getDetectionMethodWriter
public PsiXmlVariableNameWriter<CvTerm> getDetectionMethodWriter()
Getter for the field
detectionMethodWriter
.- Returns:
- a
PsiXmlVariableNameWriter
object.
-
initialiseDetectionMethodWriter
protected abstract void initialiseDetectionMethodWriter()
initialiseDetectionMethodWriter.
-
setDetectionMethodWriter
public void setDetectionMethodWriter(PsiXmlVariableNameWriter<CvTerm> detectionMethodWriter)
Setter for the field
detectionMethodWriter
.- Parameters:
detectionMethodWriter
- aPsiXmlVariableNameWriter
object.
-
getAttributeWriter
public PsiXmlElementWriter<Annotation> getAttributeWriter()
Getter for the field
attributeWriter
.- Returns:
- a
PsiXmlElementWriter
object.
-
setAttributeWriter
public void setAttributeWriter(PsiXmlElementWriter<Annotation> attributeWriter)
Setter for the field
attributeWriter
.- Parameters:
attributeWriter
- aPsiXmlElementWriter
object.
-
getConfidenceWriter
public PsiXmlElementWriter<Confidence> getConfidenceWriter()
Getter for the field
confidenceWriter
.- Returns:
- a
PsiXmlElementWriter
object.
-
initialiseConfidenceWriter
protected abstract void initialiseConfidenceWriter()
initialiseConfidenceWriter.
-
setConfidenceWriter
public void setConfidenceWriter(PsiXmlElementWriter<Confidence> confidenceWriter)
Setter for the field
confidenceWriter
.- Parameters:
confidenceWriter
- aPsiXmlElementWriter
object.
-
writeExperiment
public CvTerm writeExperiment(Experiment object) throws MIIOException
writeExperiment.
- Specified by:
writeExperiment
in 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:
write
in interfacePsiXmlElementWriter<Experiment>
- Parameters:
object
- a T object.- Throws:
MIIOException
- if any.
-
extractDefaultParticipantIdentificationMethod
public CvTerm extractDefaultParticipantIdentificationMethod(Experiment exp)
extractDefaultParticipantIdentificationMethod.
- Specified by:
extractDefaultParticipantIdentificationMethod
in interfacePsiXmlExperimentWriter
- Parameters:
exp
- aExperiment
object.- Returns:
- the default participant identification method associated with this experiment
-
writeParticipantIdentificationMethod
protected CvTerm writeParticipantIdentificationMethod(Experiment object)
writeParticipantIdentificationMethod.
- Parameters:
object
- aExperiment
object.- Returns:
- a
CvTerm
object.
-
writeVariableParameters
protected abstract void writeVariableParameters(Experiment object) throws XMLStreamException
writeVariableParameters.
- Parameters:
object
- aExperiment
object.- Throws:
XMLStreamException
- if any.
-
writeOtherProperties
protected void writeOtherProperties(Experiment object) throws XMLStreamException
writeOtherProperties.
- Parameters:
object
- aExperiment
object.- Throws:
XMLStreamException
- if any.
-
writeConfidences
protected void writeConfidences(Experiment object) throws XMLStreamException
writeConfidences.
- Parameters:
object
- aExperiment
object.- Throws:
XMLStreamException
- if any.
-
writeAttributes
protected void writeAttributes(Experiment object) throws XMLStreamException
writeAttributes.
- Parameters:
object
- aExperiment
object.- Throws:
XMLStreamException
- if any.
-
writeOtherAttributes
protected abstract void writeOtherAttributes(Experiment object, boolean needToWriteAttributeList) throws XMLStreamException
writeOtherAttributes.
- Parameters:
object
- aExperiment
object.needToWriteAttributeList
- a boolean.- Throws:
XMLStreamException
- if any.
-
writeInteractiondetectionMethod
protected void writeInteractiondetectionMethod(Experiment object) throws XMLStreamException
writeInteractiondetectionMethod.
- Parameters:
object
- aExperiment
object.- Throws:
XMLStreamException
- if any.
-
writeHostOrganism
protected void writeHostOrganism(Experiment object) throws XMLStreamException
writeHostOrganism.
- Parameters:
object
- aExperiment
object.- Throws:
XMLStreamException
- if any.
-
writePublicationAndXrefs
protected void writePublicationAndXrefs(Experiment object) throws XMLStreamException
writePublicationAndXrefs.
- Parameters:
object
- aExperiment
object.- Throws:
XMLStreamException
- if any.
-
writeExperimentXrefs
protected abstract void writeExperimentXrefs(Experiment object, String imexId) throws XMLStreamException
writeExperimentXrefs.
- Parameters:
object
- aExperiment
object.imexId
- aString
object.- Throws:
XMLStreamException
- if any.
-
writeXrefFromExperimentXrefs
protected void writeXrefFromExperimentXrefs(Experiment object, String imexId) throws XMLStreamException
writeXrefFromExperimentXrefs.
- Parameters:
object
- aExperiment
object.imexId
- aString
object.- Throws:
XMLStreamException
- if any.
-
writeNames
protected void writeNames(Experiment object) throws XMLStreamException
writeNames.
- Parameters:
object
- aExperiment
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.
-
getDefaultPublication
public Publication getDefaultPublication()
getDefaultPublication.
- Specified by:
getDefaultPublication
in 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:
setDefaultPublication
in interfacePsiXmlExperimentWriter
- Parameters:
pub
- aPublication
object.
-
initialiseDefaultPublication
protected void initialiseDefaultPublication()
initialiseDefaultPublication.
-
getVersion
protected PsiXmlVersion getVersion()
-
-