Interface IModelSerializer

All Known Implementing Classes:
JacksonModelSerializer

public interface IModelSerializer
Interface for model serializer implementations
  • Method Details

    • serialize

      String serialize(ModelVertex vertex) throws SerializationException
      Serialize a model vertex to a string value
      Parameters:
      vertex - The model vertex to serialize
      Returns:
      A serialized string representing the provided vertex
      Throws:
      SerializationException - if something went wrong during serialization
    • serialize

      String serialize(ModelEdge edge) throws SerializationException
      Serialize a model edge to a string value
      Parameters:
      edge - The model edge to serialize
      Returns:
      A serialized string representing the provided edge
      Throws:
      SerializationException - if something went wrong during serialization
    • serialize

      String serialize(ModelProject model) throws SerializationException
      Serialize a model project object to a string value
      Parameters:
      model - The model project to serialize
      Returns:
      A serialized string representing the provided model
      Throws:
      SerializationException - if something went wrong during serialization
    • serialize

      Serialize a model project resource object to a string value
      Parameters:
      model - The model project resource to serialize
      Returns:
      A serialized string representing the provided model
      Throws:
      SerializationException - if something went wrong during serialization
    • serialize

      Serialize a model editor settings object to a string value
      Parameters:
      model - The model editor settings to serialize
      Returns:
      A serialized string representing the provided model
      Throws:
      SerializationException - if something went wrong during serialization
    • deserializeProjectResource

      ModelProjectResource deserializeProjectResource(String serializedContent) throws SerializationException
      Desertialize a model project resource object from a string value
      Parameters:
      serializedContent - A string of content to deserialize
      Returns:
      A new ModelProjectResource instance based on the serialized content
      Throws:
      SerializationException - if something went wrong during deserialization
    • deserializeProjectResource

      ModelProjectResource deserializeProjectResource(File file) throws SerializationException, IOException
      Desertialize a model project resource object from a file
      Parameters:
      file - A file handle containing serialized content
      Returns:
      A new ModelProjectResource instance based on the serialized content of the provided file
      Throws:
      SerializationException - if something went wrong during deserialization
      IOException - if reading the file failed
    • deserializeProject

      ModelProject deserializeProject(String serializedContent) throws SerializationException
      Desertialize a model project object from a string value
      Parameters:
      serializedContent - A string of content to deserialize
      Returns:
      A new ModelProject instance based on the serialized content
      Throws:
      SerializationException - if something went wrong during deserialization
    • deserializeProject

      ModelProject deserializeProject(File file) throws SerializationException, IOException
      Desertialize a model project object from a file
      Parameters:
      file - A file handle containing serialized content
      Returns:
      A new ModelProject instance based on the serialized content of the provided file
      Throws:
      SerializationException - if something went wrong during deserialization
      IOException - if reading the file failed
    • deserializeEditorSettings

      ModelEditorSettings deserializeEditorSettings(String serializedContent) throws SerializationException
      Desertialize a model editor settings object from a string value
      Parameters:
      serializedContent - A string of content to deserialize
      Returns:
      A new ModelEditorSettings instance based on the serialized content
      Throws:
      SerializationException - if something went wrong during deserialization
    • deserializeEditorSettings

      ModelEditorSettings deserializeEditorSettings(File file) throws SerializationException, IOException
      Desertialize a model editor settings object from a file
      Parameters:
      file - A file handle containing serialized content
      Returns:
      A new ModelEditorSettings instance based on the serialized content of the provided file
      Throws:
      SerializationException - if something went wrong during deserialization
      IOException - if reading the file failed
    • getSupportedContentTypes

      List<String> getSupportedContentTypes()
      Get a list of supported content types. These are typically in the MIME content format
      Returns:
      A list of types that this serializer supports
    • addClassLoader

      void addClassLoader(ClassLoader loader)
      Add another classloader to the serializer. This is useful when creating plugins with non-core model objects
      Parameters:
      loader - The additional loader to use when resolving classes
    • getPreferedFileExtension

      String getPreferedFileExtension()
      Get the preferred file extension for this serializer. e.g. ".json"
      Returns:
      A string representing the preferred file extension