Package io.jans.fido2.service
Class DataMapperService
- java.lang.Object
-
- io.jans.fido2.service.DataMapperService
-
@ApplicationScoped public class DataMapperService extends Object
Conversions to/from JSON format and to/from CBOR format- Version:
- May 08, 2020
- Author:
- Yuriy Movchan
-
-
Constructor Summary
Constructors Constructor Description DataMapperService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.dataformat.cbor.CBORParser
cborCreateParser(byte[] data)
com.fasterxml.jackson.databind.JsonNode
cborReadTree(byte[] content)
byte[]
cborWriteAsBytes(com.fasterxml.jackson.databind.JsonNode jsonNode)
<T> T
convertValue(Object fromValue, Class<T> toValueType)
com.fasterxml.jackson.databind.node.ArrayNode
createArrayNode()
com.fasterxml.jackson.databind.node.ObjectNode
createObjectNode()
void
init()
com.fasterxml.jackson.databind.JsonNode
readTree(byte[] content)
com.fasterxml.jackson.databind.JsonNode
readTree(BufferedReader reader)
com.fasterxml.jackson.databind.JsonNode
readTree(String content)
<T> T
readValue(String content, Class<T> clazz)
<T> T
readValueString(String content, Class<T> clazz)
String
writeValueAsString(Object value)
-
-
-
Method Detail
-
init
@PostConstruct public void init()
-
readTree
public com.fasterxml.jackson.databind.JsonNode readTree(byte[] content) throws IOException
- Throws:
IOException
-
readTree
public com.fasterxml.jackson.databind.JsonNode readTree(String content) throws IOException
- Throws:
IOException
-
readTree
public com.fasterxml.jackson.databind.JsonNode readTree(BufferedReader reader) throws IOException
- Throws:
IOException
-
readValue
public <T> T readValue(String content, Class<T> clazz) throws IOException
- Throws:
IOException
-
createObjectNode
public com.fasterxml.jackson.databind.node.ObjectNode createObjectNode()
-
createArrayNode
public com.fasterxml.jackson.databind.node.ArrayNode createArrayNode()
-
cborReadTree
public com.fasterxml.jackson.databind.JsonNode cborReadTree(byte[] content) throws IOException
- Throws:
IOException
-
cborWriteAsBytes
public byte[] cborWriteAsBytes(com.fasterxml.jackson.databind.JsonNode jsonNode) throws IOException
- Throws:
IOException
-
cborCreateParser
public com.fasterxml.jackson.dataformat.cbor.CBORParser cborCreateParser(byte[] data) throws IOException
- Throws:
IOException
-
writeValueAsString
public String writeValueAsString(Object value) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-