public final class ModelParser extends Object
| Modifier and Type | Method and Description |
|---|---|
OctaneCollection<EntityModel> |
getEntities(String json)
get a entity model collection based on a given json string
|
org.json.JSONObject |
getEntitiesJSONObject(Collection<EntityModel> entitiesModels)
get a new json object based on a given EntityModel list
|
org.json.JSONObject |
getEntitiesJSONObject(Collection<EntityModel> entitiesModels,
boolean onlyDirty)
get a new json object based on a given EntityModel list
|
org.json.JSONObject |
getEntityJSONObject(EntityModel entityModel)
get a new json object based on a given EntityModel object
|
org.json.JSONObject |
getEntityJSONObject(EntityModel entityModel,
boolean onlyDirty)
get a new json object based on a given EntityModel object
|
EntityModel |
getEntityModel(org.json.JSONObject jsonEntityObj)
get a new EntityModel object based on json object
|
ErrorModel |
getErrorModelFromjson(String json)
GetEntities Error model based on a given error json string
|
ErrorModel |
getErrorModelFromServletJson(String json)
Parses the servlet error and extracts the underlying message that was set by Octane that can then be used by the
exception
|
Collection<ErrorModel> |
getErrorModels(String json)
GetEntities Error models based on a given error json string
|
static ModelParser |
getInstance() |
boolean |
hasErrorModel(String json)
Checks the message for an error
|
boolean |
hasErrorModels(String json)
Checks the message for a list of errors
|
boolean |
hasServletError(String json)
Checks the message for a higher-level servlet error
|
public static ModelParser getInstance()
public final org.json.JSONObject getEntityJSONObject(EntityModel entityModel)
entityModel - the given entity model objectpublic final org.json.JSONObject getEntityJSONObject(EntityModel entityModel, boolean onlyDirty)
entityModel - the given entity model objectonlyDirty - Return only dirty fields (used for updates)public final org.json.JSONObject getEntitiesJSONObject(Collection<EntityModel> entitiesModels)
entitiesModels - - Collection of entities modelspublic final org.json.JSONObject getEntitiesJSONObject(Collection<EntityModel> entitiesModels, boolean onlyDirty)
entitiesModels - - Collection of entities modelsonlyDirty - Converts only dirty fields (relevant for updating entity)public EntityModel getEntityModel(org.json.JSONObject jsonEntityObj)
jsonEntityObj - - json objectpublic OctaneCollection<EntityModel> getEntities(String json)
json - The JSON to parsepublic boolean hasErrorModels(String json)
json - The json to parsepublic boolean hasErrorModel(String json)
json - The json to parsepublic boolean hasServletError(String json)
json - The json to parsepublic Collection<ErrorModel> getErrorModels(String json)
json - - json string with error informationpublic ErrorModel getErrorModelFromjson(String json)
json - - json string with error informationpublic ErrorModel getErrorModelFromServletJson(String json)
json - The json to parseCopyright © 2021 Micro Focus. All rights reserved.