Package psidev.psi.mi.jami.json.elements
Class SimpleJsonInteractionWriter<I extends Interaction>
- java.lang.Object
-
- psidev.psi.mi.jami.json.elements.SimpleJsonInteractionWriter<I>
-
- All Implemented Interfaces:
JsonElementWriter<I>
- Direct Known Subclasses:
SimpleJsonBinaryInteractionWriter,SimpleJsonInteractionEvidenceWriter,SimpleJsonModelledInteractionWriter
public class SimpleJsonInteractionWriter<I extends Interaction> extends Object implements JsonElementWriter<I>
Json writer for interactions- Since:
18/07/14
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description SimpleJsonInteractionWriter(Writer writer, Map<Feature,Integer> processedFeatures, Map<String,String> processedInteractors, Map<Entity,Integer> processedParticipants)Constructor for SimpleJsonInteractionWriter.SimpleJsonInteractionWriter(Writer writer, Map<Feature,Integer> processedFeatures, Map<String,String> processedInteractors, Map<Entity,Integer> processedParticipants, IncrementalIdGenerator idGenerator)Constructor for SimpleJsonInteractionWriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String[]generateInteractionIdentifier(I object, Xref preferredIdentifier)generateInteractionIdentifier.JsonElementWriter<CvTerm>getCvWriter()Getter for the fieldcvWriter.OntologyTermFetchergetFetcher()Getter for the fieldfetcher.JsonElementWriter<Xref>getIdentifierWriter()Getter for the fieldidentifierWriter.IncrementalIdGeneratorgetIdGenerator()Getter for the fieldidGenerator.JsonElementWritergetParticipantWriter()Getter for the fieldparticipantWriter.protected Map<Feature,Integer>getProcessedFeatures()Getter for the fieldprocessedFeatures.protected Map<String,String>getProcessedInteractors()Getter for the fieldprocessedInteractors.protected Map<Entity,Integer>getProcessedParticipants()Getter for the fieldprocessedParticipants.protected WritergetWriter()Getter for the fieldwriter.protected booleanhasIdentifiers(I object)hasIdentifiers.protected voidinitialiseDefaultParticipantWriter()initialiseDefaultParticipantWriter.voidsetCvWriter(JsonElementWriter<CvTerm> cvWriter)Setter for the fieldcvWriter.voidsetFetcher(OntologyTermFetcher fetcher)Setter for the fieldfetcher.voidsetIdentifierWriter(JsonElementWriter<Xref> identifierWriter)Setter for the fieldidentifierWriter.voidsetIdGenerator(IncrementalIdGenerator idGenerator)Setter for the fieldidGenerator.voidsetParticipantWriter(JsonElementWriter participantWriter)Setter for the fieldparticipantWriter.voidwrite(I object)write.protected voidwriteAllIdentifiers(I object)writeAllIdentifiers.protected voidwriteExpansionMethod(CvTerm expansion)writeExpansionMethod.protected voidwriteOtherExpansionMethodProperties()writeOtherExpansionMethodProperties.protected voidwriteOtherIdentifiers(I object)writeOtherIdentifiers.protected voidwriteOtherProperties(I object)writeOtherProperties.
-
-
-
Constructor Detail
-
SimpleJsonInteractionWriter
public SimpleJsonInteractionWriter(Writer writer, Map<Feature,Integer> processedFeatures, Map<String,String> processedInteractors, Map<Entity,Integer> processedParticipants)
Constructor for SimpleJsonInteractionWriter.
-
SimpleJsonInteractionWriter
public SimpleJsonInteractionWriter(Writer writer, Map<Feature,Integer> processedFeatures, Map<String,String> processedInteractors, Map<Entity,Integer> processedParticipants, IncrementalIdGenerator idGenerator)
Constructor for SimpleJsonInteractionWriter.
- Parameters:
writer- aWriterobject.processedFeatures- aMapobject.processedInteractors- aMapobject.processedParticipants- aMapobject.idGenerator- aIncrementalIdGeneratorobject.
-
-
Method Detail
-
write
public void write(I object) throws IOException
write.
- Specified by:
writein interfaceJsonElementWriter<I extends Interaction>- Parameters:
object- a I object.- Throws:
IOException- if any.
-
generateInteractionIdentifier
protected String[] generateInteractionIdentifier(I object, Xref preferredIdentifier)
generateInteractionIdentifier.
-
writeExpansionMethod
protected void writeExpansionMethod(CvTerm expansion) throws IOException
writeExpansionMethod.
- Parameters:
expansion- aCvTermobject.- Throws:
IOException- if any.
-
writeOtherExpansionMethodProperties
protected void writeOtherExpansionMethodProperties() throws IOExceptionwriteOtherExpansionMethodProperties.
- Throws:
IOException- if any.
-
writeAllIdentifiers
protected void writeAllIdentifiers(I object) throws IOException
writeAllIdentifiers.
- Parameters:
object- a I object.- Throws:
IOException- if any.
-
writeOtherIdentifiers
protected void writeOtherIdentifiers(I object) throws IOException
writeOtherIdentifiers.
- Parameters:
object- a I object.- Throws:
IOException- if any.
-
hasIdentifiers
protected boolean hasIdentifiers(I object)
hasIdentifiers.
- Parameters:
object- a I object.- Returns:
- a boolean.
-
writeOtherProperties
protected void writeOtherProperties(I object) throws IOException
writeOtherProperties.
- Parameters:
object- a I object.- Throws:
IOException- if any.
-
getCvWriter
public JsonElementWriter<CvTerm> getCvWriter()
Getter for the field
cvWriter.- Returns:
- a
JsonElementWriterobject.
-
setCvWriter
public void setCvWriter(JsonElementWriter<CvTerm> cvWriter)
Setter for the field
cvWriter.- Parameters:
cvWriter- aJsonElementWriterobject.
-
getIdentifierWriter
public JsonElementWriter<Xref> getIdentifierWriter()
Getter for the field
identifierWriter.- Returns:
- a
JsonElementWriterobject.
-
setIdentifierWriter
public void setIdentifierWriter(JsonElementWriter<Xref> identifierWriter)
Setter for the field
identifierWriter.- Parameters:
identifierWriter- aJsonElementWriterobject.
-
getIdGenerator
public IncrementalIdGenerator getIdGenerator()
Getter for the field
idGenerator.- Returns:
- a
IncrementalIdGeneratorobject.
-
setIdGenerator
public void setIdGenerator(IncrementalIdGenerator idGenerator)
Setter for the field
idGenerator.- Parameters:
idGenerator- aIncrementalIdGeneratorobject.
-
getParticipantWriter
public JsonElementWriter getParticipantWriter()
Getter for the field
participantWriter.- Returns:
- a
JsonElementWriterobject.
-
initialiseDefaultParticipantWriter
protected void initialiseDefaultParticipantWriter()
initialiseDefaultParticipantWriter.
-
setParticipantWriter
public void setParticipantWriter(JsonElementWriter participantWriter)
Setter for the field
participantWriter.- Parameters:
participantWriter- aJsonElementWriterobject.
-
getFetcher
public OntologyTermFetcher getFetcher()
Getter for the field
fetcher.- Returns:
- a
OntologyTermFetcherobject.
-
setFetcher
public void setFetcher(OntologyTermFetcher fetcher)
Setter for the field
fetcher.- Parameters:
fetcher- aOntologyTermFetcherobject.
-
getProcessedInteractors
protected Map<String,String> getProcessedInteractors()
Getter for the field
processedInteractors.- Returns:
- a
Mapobject.
-
getProcessedFeatures
protected Map<Feature,Integer> getProcessedFeatures()
Getter for the field
processedFeatures.- Returns:
- a
Mapobject.
-
-