|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.http.representation.json.JsonMessageFactory
public class JsonMessageFactory
Parses a JSON message into its intermediate representation (Message).
Constructor Summary | |
---|---|
JsonMessageFactory()
|
Method Summary | |
---|---|
private static void |
initEntityMessage(EntityMessage entityMessage,
org.json.JSONObject jsonMessageObject,
java.util.Map<java.lang.String,java.lang.String> overridePrefixes)
Initializes the fields in Entity message based on the data read from JSON. |
private static void |
initMessage(Message message,
org.json.JSONObject jsonMessageObject,
java.util.Map<java.lang.String,java.lang.String> overridePrefixes)
Initializes the fields of the most base class (Message) with the data read from JSON. |
private static void |
initPDGMessage(PDGMessage pdgMessage,
org.json.JSONObject jsonMessageObject,
java.util.Map<java.lang.String,java.lang.String> overridePrefixes)
|
private static void |
initRDGMessage(ProtocolMessage rdgMessage,
org.json.JSONObject jsonMessageObject,
java.util.Map<java.lang.String,java.lang.String> overridePrefixes,
boolean mappingOptional)
Initializes the fields in RDG message based on the data read from JSON. |
static EntityMessage |
parseJsonEntityMessage(java.lang.String jsonMessage,
java.util.Map<java.lang.String,java.lang.String> overridePrefixes)
A public method to parse a string that contains an EntityMessage encoded as JSON. |
static PDGMessage |
parseJsonPDGMessage(java.lang.String jsonMessage,
java.util.Map<java.lang.String,java.lang.String> overridePrefixes)
|
static ProtocolMessage |
parseJsonProtocolMessage(java.lang.String jsonMessage,
java.util.Map<java.lang.String,java.lang.String> overridePrefixes,
boolean optionalMapping)
A public method to parse a string that contains an SSWAP Canonical Graph (a protocol message) encoded as JSON. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JsonMessageFactory()
Method Detail |
---|
private static void initMessage(Message message, org.json.JSONObject jsonMessageObject, java.util.Map<java.lang.String,java.lang.String> overridePrefixes) throws org.json.JSONException
message
- the message object to be initializedjsonMessageObject
- the JSON object describing the message
org.json.JSONException
- if the JSON has invalid structureprivate static void initEntityMessage(EntityMessage entityMessage, org.json.JSONObject jsonMessageObject, java.util.Map<java.lang.String,java.lang.String> overridePrefixes) throws org.json.JSONException
entityMessage
- the entity message to be initializedjsonMessageObject
- the JSON object describing the message
org.json.JSONException
- if the JSON has invalid structureprivate static void initRDGMessage(ProtocolMessage rdgMessage, org.json.JSONObject jsonMessageObject, java.util.Map<java.lang.String,java.lang.String> overridePrefixes, boolean mappingOptional) throws org.json.JSONException
rdgMessage
- the RDGMessage to be initializedjsonMessageObject
- the JSON object describing the message
org.json.JSONException
- if the JSON has invalid structureprivate static void initPDGMessage(PDGMessage pdgMessage, org.json.JSONObject jsonMessageObject, java.util.Map<java.lang.String,java.lang.String> overridePrefixes) throws org.json.JSONException
org.json.JSONException
public static EntityMessage parseJsonEntityMessage(java.lang.String jsonMessage, java.util.Map<java.lang.String,java.lang.String> overridePrefixes) throws org.json.JSONException
jsonMessage
- the string with JSON data
org.json.JSONException
- if the JSON cannot be parsed or if it contains invalid structure.public static ProtocolMessage parseJsonProtocolMessage(java.lang.String jsonMessage, java.util.Map<java.lang.String,java.lang.String> overridePrefixes, boolean optionalMapping) throws org.json.JSONException
jsonMessage
- the string with JSON data
org.json.JSONException
- if the JSON cannot be parsed or if it contains invalid structure.public static PDGMessage parseJsonPDGMessage(java.lang.String jsonMessage, java.util.Map<java.lang.String,java.lang.String> overridePrefixes) throws org.json.JSONException
org.json.JSONException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |