/** * toXMI - takes a root MDMI node object and writes it out into a blank MDMI map. * * @param path The path of the output MDMI map. * @param root The root MDMI node object that will be attached to the resulting Message Model. */ public static void toXMI(String path, Node root) { List<MessageGroup> messageGroups = new ArrayList<MessageGroup>(); MessageGroup messageGroup = new MessageGroup(); MessageModel messageModel = new MessageModel(); MessageSyntaxModel syntaxModel = new MessageSyntaxModel(); syntaxModel.setRoot(root); messageModel.setSyntaxModel(syntaxModel); messageGroup.addModel(messageModel); messageGroups.add(messageGroup); try { XMIWriterDirect.write(path, messageGroups); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
protected void loadChildren(MessageModel model) { // Semantic Element Set SemanticElementSet elemSet = model.getElementSet(); if (elemSet == null) { elemSet = new SemanticElementSet(); model.setElementSet(elemSet); } EditableObjectNode elemSetNode = new SemanticElementSetNode(elemSet); add(elemSetNode); // Message Syntax Model MessageSyntaxModel syntaxModel = model.getSyntaxModel(); if (syntaxModel == null) { syntaxModel = new MessageSyntaxModel(); model.setSyntaxModel(syntaxModel); } EditableObjectNode syntaxNode = new MessageSyntaxModelNode(syntaxModel); add(syntaxNode); }