Package psidev.psi.mi.jami.json
Class MIJsonUtils
- java.lang.Object
-
- psidev.psi.mi.jami.json.MIJsonUtils
-
public class MIJsonUtils extends Object
Utility class for public properties- Since:
05/07/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLOSEConstantCLOSE="}"static StringCLOSE_ARRAYConstantCLOSE_ARRAY="]"static StringELEMENT_SEPARATORConstantELEMENT_SEPARATOR=","static StringINDENTConstantINDENT="\t"static StringLINE_SEPARATORConstantLINE_SEPARATOR="System.getProperty(line.separator)"static StringOPENConstantOPEN="{"static StringOPEN_ARRAYConstantOPEN_ARRAY="["static StringPROPERTY_DELIMITERConstantPROPERTY_DELIMITER="\""static StringPROPERTY_VALUE_SEPARATORConstantPROPERTY_VALUE_SEPARATOR=":"
-
Constructor Summary
Constructors Constructor Description MIJsonUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]extractBinaryInteractionId(Xref ref, BinaryInteraction interaction, Integer number)extractBinaryInteractionId.static String[]extractInteractionId(Xref ref, Interaction interaction)extractInteractionId.static String[]extractInteractorId(Xref ref, Interactor interactor)extractInteractorId.static voidwriteEndArray(Writer writer)writeEndArray.static voidwriteEndObject(Writer writer)writeEndObject.static voidwriteOpenArray(Writer writer)writeOpenArray.static voidwriteProperty(String propertyName, String value, Writer writer)writeProperty.static voidwritePropertyKey(String key, Writer writer)writePropertyKey.static voidwritePropertyValue(String value, Writer writer)writePropertyValue.static voidwriteSeparator(Writer writer)writeSeparator.static voidwriteStartObject(Writer writer)writeStartObject.
-
-
-
Field Detail
-
OPEN
public static final String OPEN
ConstantOPEN="{"- See Also:
- Constant Field Values
-
CLOSE
public static final String CLOSE
ConstantCLOSE="}"- See Also:
- Constant Field Values
-
OPEN_ARRAY
public static final String OPEN_ARRAY
ConstantOPEN_ARRAY="["- See Also:
- Constant Field Values
-
CLOSE_ARRAY
public static final String CLOSE_ARRAY
ConstantCLOSE_ARRAY="]"- See Also:
- Constant Field Values
-
PROPERTY_DELIMITER
public static final String PROPERTY_DELIMITER
ConstantPROPERTY_DELIMITER="\""- See Also:
- Constant Field Values
-
PROPERTY_VALUE_SEPARATOR
public static final String PROPERTY_VALUE_SEPARATOR
ConstantPROPERTY_VALUE_SEPARATOR=":"- See Also:
- Constant Field Values
-
ELEMENT_SEPARATOR
public static final String ELEMENT_SEPARATOR
ConstantELEMENT_SEPARATOR=","- See Also:
- Constant Field Values
-
LINE_SEPARATOR
public static final String LINE_SEPARATOR
ConstantLINE_SEPARATOR="System.getProperty(line.separator)"
-
INDENT
public static final String INDENT
ConstantINDENT="\t"- See Also:
- Constant Field Values
-
-
Method Detail
-
writePropertyKey
public static void writePropertyKey(String key, Writer writer) throws IOException
writePropertyKey.
- Parameters:
key- aStringobject.writer- aWriterobject.- Throws:
IOException- if any.
-
writePropertyValue
public static void writePropertyValue(String value, Writer writer) throws IOException
writePropertyValue.
- Parameters:
value- aStringobject.writer- aWriterobject.- Throws:
IOException- if any.
-
writeProperty
public static void writeProperty(String propertyName, String value, Writer writer) throws IOException
writeProperty.
- Parameters:
propertyName- aStringobject.value- aStringobject.writer- aWriterobject.- Throws:
IOException- if any.
-
writeStartObject
public static void writeStartObject(Writer writer) throws IOException
writeStartObject.
- Parameters:
writer- aWriterobject.- Throws:
IOException- if any.
-
writeEndObject
public static void writeEndObject(Writer writer) throws IOException
writeEndObject.
- Parameters:
writer- aWriterobject.- Throws:
IOException- if any.
-
writeSeparator
public static void writeSeparator(Writer writer) throws IOException
writeSeparator.
- Parameters:
writer- aWriterobject.- Throws:
IOException- if any.
-
writeOpenArray
public static void writeOpenArray(Writer writer) throws IOException
writeOpenArray.
- Parameters:
writer- aWriterobject.- Throws:
IOException- if any.
-
writeEndArray
public static void writeEndArray(Writer writer) throws IOException
writeEndArray.
- Parameters:
writer- aWriterobject.- Throws:
IOException- if any.
-
extractInteractorId
public static String[] extractInteractorId(Xref ref, Interactor interactor)
extractInteractorId.
- Parameters:
ref- aXrefobject.interactor- aInteractorobject.- Returns:
- an array of String : first the database, then the interactorId
-
extractInteractionId
public static String[] extractInteractionId(Xref ref, Interaction interaction)
extractInteractionId.
- Parameters:
ref- aXrefobject.interaction- aInteractionobject.- Returns:
- an array of String : first the database, then the interactionId
-
extractBinaryInteractionId
public static String[] extractBinaryInteractionId(Xref ref, BinaryInteraction interaction, Integer number)
extractBinaryInteractionId.
- Parameters:
ref- aXrefobject.interaction- aBinaryInteractionobject.number- a suffix- Returns:
- an array of String : first the database, then the interactionId, then a number to append
-
-