public class JsonParser extends Object
| Constructor and Description |
|---|
JsonParser() |
| Modifier and Type | Method and Description |
|---|---|
protected SCIMAttribute |
create(AttributeDescriptor descriptor,
Object jsonAttribute)
Create a SCIM attribute from its JSON object representation.
|
protected SCIMAttributeValue |
createComplexAttribute(org.json.JSONObject jsonAttribute,
AttributeDescriptor attributeDescriptor)
Parse a complex attribute from its representation as a JSON Object.
|
protected SCIMAttribute |
createMultiValuedAttribute(org.json.JSONArray jsonAttribute,
AttributeDescriptor attributeDescriptor)
Parse a multi-valued attribute from its representation as a JSON Array.
|
protected SCIMAttribute |
createSimpleAttribute(Object jsonAttribute,
AttributeDescriptor attributeDescriptor)
Parse a simple attribute from its representation as a JSON Object.
|
protected <R extends BaseResource> |
unmarshal(org.json.JSONObject jsonObject,
ResourceDescriptor resourceDescriptor,
ResourceFactory<R> resourceFactory,
org.json.JSONArray defaultSchemas)
Read a SCIM resource from the specified JSON object.
|
public JsonParser()
protected <R extends BaseResource> R unmarshal(org.json.JSONObject jsonObject, ResourceDescriptor resourceDescriptor, ResourceFactory<R> resourceFactory, org.json.JSONArray defaultSchemas) throws org.json.JSONException, InvalidResourceException
R - The type of resource instance.jsonObject - The JSON object to be read.resourceDescriptor - The descriptor of the SCIM resource to be read.resourceFactory - The resource factory to use to create the resource
instance.defaultSchemas - The set of schemas used by attributes of the
resource, or null if the schemas must be
provided in the resource object.org.json.JSONException - If an error occurred.InvalidResourceException - if a schema error occurs.protected SCIMAttribute createSimpleAttribute(Object jsonAttribute, AttributeDescriptor attributeDescriptor)
jsonAttribute - The JSON object representing the attribute.attributeDescriptor - The attribute descriptor.protected SCIMAttribute createMultiValuedAttribute(org.json.JSONArray jsonAttribute, AttributeDescriptor attributeDescriptor) throws org.json.JSONException, InvalidResourceException
jsonAttribute - The JSON array representing the attribute.attributeDescriptor - The attribute descriptor.null if there are no non-null
values in the array.org.json.JSONException - Thrown if error creating multi-valued attribute.InvalidResourceException - if a schema error occurs.protected SCIMAttributeValue createComplexAttribute(org.json.JSONObject jsonAttribute, AttributeDescriptor attributeDescriptor) throws org.json.JSONException, InvalidResourceException
jsonAttribute - The JSON object representing the attribute.attributeDescriptor - The attribute descriptor.org.json.JSONException - Thrown if error creating complex attribute.InvalidResourceException - if a schema error occurs.protected SCIMAttribute create(AttributeDescriptor descriptor, Object jsonAttribute) throws org.json.JSONException, InvalidResourceException
descriptor - The attribute descriptor.jsonAttribute - The JSON object representing the attribute.null if the value is null.org.json.JSONException - If the JSON object is not valid.InvalidResourceException - If a schema error occurs.Copyright © 2011–2016 UnboundID. All rights reserved.