Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
}
fqName(it)
}
val smodelAttributes = SNodeOperations
.getChildren(concept, LINKS.smodelAttribute)
.map(MPSModelExporter::exportNode)
val metaProperties: MutableMap<String, String> = HashMap()
if (SPropertyOperations.getString(concept, PROPS.conceptAlias) != null) {
metaProperties[ConceptData.ALIAS_KEY] =
Expand All @@ -127,6 +130,7 @@
referenceLinks,
superConcepts,
deprecationMsg(concept),
smodelAttributes,
metaProperties,
)
}
Expand Down Expand Up @@ -295,6 +299,13 @@
0xeeb344f63fe016cL,
"defaultMember",
)
val smodelAttribute: SContainmentLink = MetaAdapterFactory.getContainmentLink(
-0x3154ae6ada15b0deL,
-0x646defc46a3573f4L,
0x10802efe25aL,

Check warning

Code scanning / detekt

This expression contains a magic number. Consider defining it to a well named constant. Warning

This expression contains a magic number. Consider defining it to a well named constant.
0x47bf8397520e5942L,

Check warning

Code scanning / detekt

This expression contains a magic number. Consider defining it to a well named constant. Warning

This expression contains a magic number. Consider defining it to a well named constant.
"smodelAttribute",
)
}

private object PROPS {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,23 @@
return data
}

private fun exportNode(node: SNode): NodeData {
val id: String = node.reference.toString()
val concept: String = "mps:" + MetaIdHelper.getConcept(SNodeOperations.getConcept(node)).serialize()
val role = node.containmentLink?.name ?: "rootNodes"
val children: List<NodeData> = SNodeOperations.getChildren(node).map { exportNode(it) }
val properties: MutableMap<String, String> = LinkedHashMap()
val references: MutableMap<String, String> = LinkedHashMap()
properties["#mpsNodeId#"] = node.nodeId.toString()
for (property: SProperty in node.properties) {
properties[property.name] = node.getProperty(property) ?: continue
}
for (reference: SReference in node.references) {
references[reference.link.name] = reference.targetNodeReference.toString()
companion object {
fun exportNode(node: SNode): NodeData {

Check warning

Code scanning / detekt

The function exportNode is missing documentation. Warning

The function exportNode is missing documentation.
val id: String = node.reference.toString()
val concept: String = "mps:" + MetaIdHelper.getConcept(SNodeOperations.getConcept(node)).serialize()
val role = node.containmentLink?.name ?: "rootNodes"
val children: List<NodeData> = SNodeOperations.getChildren(node).map { exportNode(it) }
val properties: MutableMap<String, String> = LinkedHashMap()
val references: MutableMap<String, String> = LinkedHashMap()
properties["#mpsNodeId#"] = node.nodeId.toString()
for (property: SProperty in node.properties) {
properties[property.name] = node.getProperty(property) ?: continue
}
for (reference: SReference in node.references) {
references[reference.link.name] = reference.targetNodeReference.toString()
}
return NodeData(id, concept, role, children, properties, references)
}
return NodeData(id, concept, role, children, properties, references)
}

Check warning

Code scanning / detekt

Companion is missing required documentation. Warning

Companion is missing required documentation.

private object CONCEPTS {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ data class ConceptData(
val references: List<ReferenceLinkData> = emptyList(),
val extends: List<String> = emptyList(),
override val deprecationMessage: String? = null,
val smodelAttributes: List<NodeData> = emptyList(),
val metaProperties: MutableMap<String, String> = mutableMapOf(),
) : IDeprecatable {
companion object {
Expand Down
Loading