Skip to content

peteruhnak/xmi-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I no longer maintain this project, please follow the link above.


XMI Analyzer

Build Status Coverage Status

XMI Analyzer is a (prototype) utility assisting in analyzing XMI files.

Sponsored by Synectique

Note that XMI is a subset of XML with rather specific rulues.

Installation

Metacello new
	baseline: 'XMIAnalyzer';
	repository: 'github://peteruhnak/xmi-analyzer/repository';
	load.

Instead of operating on the DOM this tool will generate appropriate classes for the individual node types and will instantiate them from the XMI.

The instantiation includes:

  • basic type inference (booleans, numbers, strings, IDREF(s))
  • reference resolution
    • instead of having string IDs in the DOM, the instances will have proper object references

Usage

"get an instance of DOM tree"
"dom := XMLDOMParser parse: FileLocator home asFileReference / 'prog/xmi/examples/smr2.xml'."
dom := XMIAnalyzer sampleStateMachineXmi.

"Generate the necessary classes. Prefix will be added before all generated classes."
XMIAnalyzer createClassesFor: dom prefixed: 'SMX' in: 'MyGeneratedClasses'.

"Create the instances in the generated classes."
instance := XMIAnalyzer createInstanceOf: dom prefixed: 'SMX'.

"Inspect the instance"
instance inspect.

"Apply a simple Mondrian demo visualization (requires Roassal)"
(XMIAnalyzer sampleStateMachineVisualization: instance) open.

Example

In-image example is available after running XMIAnalyzer>>exampleStateMachineScenario

Example usage on some XMI:

Example usage

Original XMI

Original XMI

Generated classes for the tree

Generated classes

Inspecting the instantiated model

Inspecting XMI instance

Simple Roassal visualization of the content.

Roassal visualization with Mondrian

About

A utility for XMI analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published