public class JSONDecoder extends Object
| Constructor and Description |
|---|
JSONDecoder() |
| Modifier and Type | Method and Description |
|---|---|
ComplexAttribute |
buildComplexAttribute(AttributeSchema complexAttributeSchema,
org.json.JSONObject jsonObject) |
MultiValuedAttribute |
buildComplexMultiValuedAttribute(AttributeSchema attributeSchema,
org.json.JSONArray attributeValues) |
MultiValuedAttribute |
buildPrimitiveMultiValuedAttribute(AttributeSchema attributeSchema,
org.json.JSONArray attributeValues) |
SimpleAttribute |
buildSimpleAttribute(AttributeSchema attributeSchema,
Object attributeValue) |
AbstractSCIMObject |
decode(String scimResourceString,
SCIMResourceTypeSchema schema) |
BulkRequestData |
decodeBulkData(String bulkResourceString)
Decode BulkRequestData Json Sting.
|
AbstractCharonException |
decodeCharonException(String scimErrorString)
this method can be used to decode a scim response with the error schema into an
AbstractCharonException |
<T extends AbstractCharonException> |
decodeCharonException(String scimErrorString,
Class<T> exceptionType)
this method can be used to decode a scim response with the error schema into an
AbstractCharonException |
<T extends AbstractSCIMObject> |
decodeListedResource(String scimResourceString,
ResourceTypeSchema resourceSchema,
Class<T> scimObjectType)
decodes a string that should match the
SCIMConstants.LISTED_RESOURCE_CORE_SCHEMA_URI scheme to
ListedResource object that holds the parsed objects |
ArrayList<PatchOperation> |
decodeRequest(String scimResourceString) |
<T extends AbstractSCIMObject> |
decodeResource(String scimResourceString,
ResourceTypeSchema resourceSchema,
T scimObject)
Decode the resource string sent in the SCIM request payload.
|
SearchRequest |
decodeSearchRequestBody(String scimResourceString,
SCIMResourceTypeSchema schema) |
List<String> |
toList(org.json.JSONArray array)
Converts a JSONArray to a List
|
public <T extends AbstractSCIMObject> ListedResource decodeListedResource(String scimResourceString, ResourceTypeSchema resourceSchema, Class<T> scimObjectType) throws BadRequestException, CharonException
SCIMConstants.LISTED_RESOURCE_CORE_SCHEMA_URI scheme to
ListedResource object that holds the parsed objectsT - a AbstractSCIMObject type as Group or UserscimResourceString - the listed resource stringresourceSchema - the schema of the resource objects that should be present.scimObjectType - the type of the scim resourcesBadRequestException - if the json could not be parsedCharonException - if a value of the json contains data in an unexpected format or typepublic AbstractCharonException decodeCharonException(String scimErrorString) throws BadRequestException, CharonException
AbstractCharonExceptionBadRequestExceptionCharonExceptionpublic <T extends AbstractCharonException> T decodeCharonException(String scimErrorString, Class<T> exceptionType) throws BadRequestException, CharonException
AbstractCharonExceptionBadRequestExceptionCharonExceptionpublic <T extends AbstractSCIMObject> T decodeResource(String scimResourceString, ResourceTypeSchema resourceSchema, T scimObject) throws BadRequestException, CharonException, InternalErrorException
scimResourceString - - json encoded string of user inforesourceSchema - - SCIM defined user schemascimObject - - a container holding the attributes and schema listBadRequestExceptionCharonExceptionInternalErrorExceptionpublic List<String> toList(org.json.JSONArray array) throws org.json.JSONException
array - JSONArray object.org.json.JSONException - Error when creating List from JSONArray.public SimpleAttribute buildSimpleAttribute(AttributeSchema attributeSchema, Object attributeValue) throws CharonException, BadRequestException
CharonExceptionBadRequestExceptionpublic MultiValuedAttribute buildComplexMultiValuedAttribute(AttributeSchema attributeSchema, org.json.JSONArray attributeValues) throws CharonException, BadRequestException
CharonExceptionBadRequestExceptionpublic MultiValuedAttribute buildPrimitiveMultiValuedAttribute(AttributeSchema attributeSchema, org.json.JSONArray attributeValues) throws CharonException, BadRequestException
CharonExceptionBadRequestExceptionpublic ComplexAttribute buildComplexAttribute(AttributeSchema complexAttributeSchema, org.json.JSONObject jsonObject) throws BadRequestException, CharonException, InternalErrorException, org.json.JSONException
BadRequestExceptionCharonExceptionInternalErrorExceptionorg.json.JSONExceptionpublic ArrayList<PatchOperation> decodeRequest(String scimResourceString) throws BadRequestException
BadRequestExceptionpublic AbstractSCIMObject decode(String scimResourceString, SCIMResourceTypeSchema schema) throws CharonException, BadRequestException
CharonExceptionBadRequestExceptionpublic SearchRequest decodeSearchRequestBody(String scimResourceString, SCIMResourceTypeSchema schema) throws BadRequestException
BadRequestExceptionpublic BulkRequestData decodeBulkData(String bulkResourceString) throws BadRequestException
bulkResourceString - BadRequestExceptionCopyright © 2022 WSO2. All rights reserved.