Documentation Language: Swift

Class

JSONParser

Parser for JSON files in emfjson/pyecore format

actor JSONParser

Overview

The JSON parser converts JSON files into EMF-compatible object graphs stored in Resources. It handles:

JSON Format

Single root object:

{
  "eClass": "http://package.uri#//ClassName",
  "attribute": "value",
  "reference": { ... }
}

Multiple root objects:

[
  { "eClass": "...", ... },
  { "eClass": "...", ... }
]

Usage Example

let parser = JSONParser()
let resource = try await parser.parse(jsonURL)
let roots = await resource.getRootObjects()

Topics

Initializers

?
init(resourceSet:)

Initializes a new JSON parser

Instance Methods

F
parse(_:)

Parse a JSON file and return a Resource containing the objects

Default Implementations

Relationships

Conforms To

See Also

Resources and Serialisation

?
Resource

A resource manages model objects and provides EMF-compliant reference resolution.

?
ResourceSet

A resource set manages multiple resources and enables cross-resource reference resolution.

?
XMIParser

Parser for XMI (XML Metadata Interchange) files

S
XMISerializer

Serialises EMF objects to XMI (XML Metadata Interchange) format

S
JSONSerializer

Serializes EMF objects to JSON format (emfjson/pyecore compatible)