Class JsonDeSers

java.lang.Object
de.monticore.symboltable.serialization.JsonDeSers

public class JsonDeSers extends Object
Collection of (static) methods and constants that support using DeSers in combination with Json.
  • Field Details

  • Constructor Details

    • JsonDeSers

      public JsonDeSers()
  • Method Details

    • getPackage

      public static String getPackage(JsonObject scopeJson)
      This method deserializes a stored package. If no package is stored, the default empty package ("") is returned.
      Parameters:
      scopeJson -
      Returns:
    • getSymbols

      public static List<JsonObject> getSymbols(JsonObject scopeJson)
      This method returns a list of JsonObjects from a passed serialized scope.
      Parameters:
      scopeJson -
      Returns:
    • getKind

      public static String getKind(JsonObject symbol)
    • getKindOpt

      public static Optional<String> getKindOpt(JsonObject symbol)
    • checkCorrectDeSerForKind

      public static void checkCorrectDeSerForKind(String deSerKind, JsonElement serializedElement)
      This method checks, if a passed JsonElement is a Json object of a certain passed kind. It is useful to check, whether a DeSer that can deserialize the passed deSerSymbolKind is capable of deserializing the passed serializedElement.
      Parameters:
      deSerKind -
      serializedElement -
    • getSymbolFilePath

      public static String getSymbolFilePath(String symbolPath, String modelName, String modelFileExtension)
    • getSymbolFilePath

      public static String getSymbolFilePath(String symbolPath, String packagePath, String modelName, String modelFileExtension)