Package org.mycore.mcr.acl.accesskey
Class MCRAccessKeyTransformer
java.lang.Object
org.mycore.mcr.acl.accesskey.MCRAccessKeyTransformer
Methods for transforming
MCRAccessKey
between JSON.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MCRAccessKey
accessKeyFromJson
(String json) Transforms JSON to aMCRAccessKey
.static List<MCRAccessKey>
accessKeysFromElement
(MCRObjectID objectId, Element element) Transforms service element toMCRAccessKey
liststatic List<MCRAccessKey>
accessKeysFromJson
(String json) Transforms JSON toMCRAccessKey
list.static Element
elementFromAccessKeys
(List<MCRAccessKey> accessKeys) TransformsMCRAccessKey
list to a elementstatic String
jsonFromAccessKey
(MCRAccessKey accessKey) Transforms aMCRAccessKey
to JSON.static String
jsonFromAccessKeys
(List<MCRAccessKey> accessKeys) Transforms aMCRAccessKey
list to JSON.
-
Field Details
-
ACCESS_KEY_TYPE
Name of accesskeys element.- See Also:
-
-
Constructor Details
-
MCRAccessKeyTransformer
public MCRAccessKeyTransformer()
-
-
Method Details
-
accessKeyFromJson
public static MCRAccessKey accessKeyFromJson(String json) throws MCRAccessKeyTransformationException Transforms JSON to aMCRAccessKey
.- Parameters:
json
- the json- Returns:
- the
MCRAccessKey
- Throws:
MCRAccessKeyTransformationException
- if the transformation fails
-
accessKeysFromJson
public static List<MCRAccessKey> accessKeysFromJson(String json) throws MCRAccessKeyTransformationException Transforms JSON toMCRAccessKey
list.- Parameters:
json
- the json- Returns:
- the
MCRAccessKey
list - Throws:
MCRAccessKeyTransformationException
- if the transformation fails
-
jsonFromAccessKey
public static String jsonFromAccessKey(MCRAccessKey accessKey) throws MCRAccessKeyTransformationException Transforms aMCRAccessKey
to JSON.- Parameters:
accessKey
- theMCRAccessKey
- Returns:
- access key as json string
- Throws:
MCRAccessKeyTransformationException
- if the transformation fails
-
jsonFromAccessKeys
public static String jsonFromAccessKeys(List<MCRAccessKey> accessKeys) throws MCRAccessKeyTransformationException Transforms aMCRAccessKey
list to JSON.- Parameters:
accessKeys
- theMCRAccessKey
list- Returns:
- access keys as json array string
- Throws:
MCRAccessKeyTransformationException
- if the transformation fails
-
accessKeysFromElement
public static List<MCRAccessKey> accessKeysFromElement(MCRObjectID objectId, Element element) throws MCRAccessKeyTransformationException Transforms service element toMCRAccessKey
list- Parameters:
objectId
- the linkedMCRObjectID
element
- the service element- Returns:
- the
MCRAccessKey
list - Throws:
MCRAccessKeyTransformationException
- if the transformation fails
-
elementFromAccessKeys
public static Element elementFromAccessKeys(List<MCRAccessKey> accessKeys) throws MCRAccessKeyTransformationException TransformsMCRAccessKey
list to a element- Parameters:
accessKeys
- theMCRAccessKey
list- Returns:
- the accesskeys element with access key list as json string as content
- Throws:
MCRAccessKeyTransformationException
- if the transformation fails
-