Class ResourceAttributeUtil
- java.lang.Object
-
- com.sun.identity.entitlement.xacml3.ResourceAttributeUtil
-
public class ResourceAttributeUtil extends Object
Provides the ability to convert the ResourceAttribute representation to JSON and back again. Conversion performed by this class will use standard JSON serialisation/deserialisation.
-
-
Field Summary
Fields Modifier and Type Field Description static intJSON_PARSE_ERRORstatic StringSEP
-
Constructor Summary
Constructors Constructor Description ResourceAttributeUtil()Create a default instance of the ResourceAttributeUtil.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceAttributefromJSON(String json)Convert the JSON text into aResourceAttribute.StringtoJSON(ResourceAttribute attribute)Convert aPrivilegeResourceAttributeinto JSON representation.
-
-
-
Field Detail
-
JSON_PARSE_ERROR
public static final int JSON_PARSE_ERROR
- See Also:
- Constant Field Values
-
SEP
public static final String SEP
- See Also:
- Constant Field Values
-
-
Method Detail
-
toJSON
public String toJSON(ResourceAttribute attribute) throws EntitlementException
Convert aPrivilegeResourceAttributeinto JSON representation.- Parameters:
attribute- Non null attribute.- Returns:
- String format representation. Non null.
- Throws:
EntitlementException- If there was an unexpected error during conversion.
-
fromJSON
public ResourceAttribute fromJSON(String json) throws EntitlementException
Convert the JSON text into aResourceAttribute.- Parameters:
json- Non null, maybe empty.- Returns:
- Null if json was empty, otherwise a ResourceAttribute.
- Throws:
EntitlementException- If there was an unexpected error during conversion.
-
-