Class JsonSerializer
- java.lang.Object
-
- io.adminshell.aas.v3.dataformat.json.JsonSerializer
-
- All Implemented Interfaces:
ReferableSerializer,Serializer
public class JsonSerializer extends Object implements Serializer, ReferableSerializer
Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to JSON.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.databind.json.JsonMappermapper-
Fields inherited from interface io.adminshell.aas.v3.dataformat.Serializer
DEFAULT_CHARSET
-
-
Constructor Summary
Constructors Constructor Description JsonSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.fasterxml.jackson.databind.module.SimpleModulebuildCustomSerializerModule()protected com.fasterxml.jackson.databind.module.SimpleModulebuildEnumModule()protected voidbuildMapper()Stringwrite(io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment aasEnvironment)Stringwrite(io.adminshell.aas.v3.model.Referable referable)Serializes a given instance of a Referable to stringStringwrite(List<io.adminshell.aas.v3.model.Referable> referables)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.adminshell.aas.v3.dataformat.Serializer
write, write, write, write
-
-
-
-
Method Detail
-
buildMapper
protected void buildMapper()
-
buildCustomSerializerModule
protected com.fasterxml.jackson.databind.module.SimpleModule buildCustomSerializerModule()
-
buildEnumModule
protected com.fasterxml.jackson.databind.module.SimpleModule buildEnumModule()
-
write
public String write(io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment aasEnvironment) throws SerializationException
- Specified by:
writein interfaceSerializer- Throws:
SerializationException
-
write
public String write(io.adminshell.aas.v3.model.Referable referable) throws SerializationException
Description copied from interface:ReferableSerializerSerializes a given instance of a Referable to string- Specified by:
writein interfaceReferableSerializer- Parameters:
referable- the referable to serialize- Returns:
- the string representation of the referable
- Throws:
SerializationException- if serialization fails
-
write
public String write(List<io.adminshell.aas.v3.model.Referable> referables) throws SerializationException
- Specified by:
writein interfaceReferableSerializer- Parameters:
referables- the referables to serialize- Returns:
- the string representation of the list of referables
- Throws:
SerializationException- if serialization fails
-
-