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 String
CLOSE
ConstantCLOSE="}"
static String
CLOSE_ARRAY
ConstantCLOSE_ARRAY="]"
static String
ELEMENT_SEPARATOR
ConstantELEMENT_SEPARATOR=","
static String
INDENT
ConstantINDENT="\t"
static String
LINE_SEPARATOR
ConstantLINE_SEPARATOR="System.getProperty(line.separator)"
static String
OPEN
ConstantOPEN="{"
static String
OPEN_ARRAY
ConstantOPEN_ARRAY="["
static String
PROPERTY_DELIMITER
ConstantPROPERTY_DELIMITER="\""
static String
PROPERTY_VALUE_SEPARATOR
ConstantPROPERTY_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 void
writeEndArray(Writer writer)
writeEndArray.static void
writeEndObject(Writer writer)
writeEndObject.static void
writeOpenArray(Writer writer)
writeOpenArray.static void
writeProperty(String propertyName, String value, Writer writer)
writeProperty.static void
writePropertyKey(String key, Writer writer)
writePropertyKey.static void
writePropertyValue(String value, Writer writer)
writePropertyValue.static void
writeSeparator(Writer writer)
writeSeparator.static void
writeStartObject(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
- aString
object.writer
- aWriter
object.- Throws:
IOException
- if any.
-
writePropertyValue
public static void writePropertyValue(String value, Writer writer) throws IOException
writePropertyValue.
- Parameters:
value
- aString
object.writer
- aWriter
object.- Throws:
IOException
- if any.
-
writeProperty
public static void writeProperty(String propertyName, String value, Writer writer) throws IOException
writeProperty.
- Parameters:
propertyName
- aString
object.value
- aString
object.writer
- aWriter
object.- Throws:
IOException
- if any.
-
writeStartObject
public static void writeStartObject(Writer writer) throws IOException
writeStartObject.
- Parameters:
writer
- aWriter
object.- Throws:
IOException
- if any.
-
writeEndObject
public static void writeEndObject(Writer writer) throws IOException
writeEndObject.
- Parameters:
writer
- aWriter
object.- Throws:
IOException
- if any.
-
writeSeparator
public static void writeSeparator(Writer writer) throws IOException
writeSeparator.
- Parameters:
writer
- aWriter
object.- Throws:
IOException
- if any.
-
writeOpenArray
public static void writeOpenArray(Writer writer) throws IOException
writeOpenArray.
- Parameters:
writer
- aWriter
object.- Throws:
IOException
- if any.
-
writeEndArray
public static void writeEndArray(Writer writer) throws IOException
writeEndArray.
- Parameters:
writer
- aWriter
object.- Throws:
IOException
- if any.
-
extractInteractorId
public static String[] extractInteractorId(Xref ref, Interactor interactor)
extractInteractorId.
- Parameters:
ref
- aXref
object.interactor
- aInteractor
object.- Returns:
- an array of String : first the database, then the interactorId
-
extractInteractionId
public static String[] extractInteractionId(Xref ref, Interaction interaction)
extractInteractionId.
- Parameters:
ref
- aXref
object.interaction
- aInteraction
object.- 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
- aXref
object.interaction
- aBinaryInteraction
object.number
- a suffix- Returns:
- an array of String : first the database, then the interactionId, then a number to append
-
-