de.interactive_instruments.ShapeChange.Model.Xmi10
Class Xmi10Document

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.Model.ModelImpl
      extended by de.interactive_instruments.ShapeChange.Model.Xmi10.Xmi10Document
All Implemented Interfaces:
Model

public class Xmi10Document
extends ModelImpl
implements Model


Field Summary
 Document document
           
protected  String dtd
           
protected  HashMap<String,AssociationInfo> fAssociations
          Hash table for associations
protected  HashMap<String,ClassInfo> fClasses
          Hash table for all classes and classnames
protected  HashMap<String,Multiplicity> fClassesRoseHiddenCardinality
           
 HashMap<String,String> fClassesRoseHiddenLabels
           
protected  HashMap<String,ClassInfo> fClassnames
           
protected  HashMap<String,PackageInfo> fPackages
          Hash table for all relevant packages
protected  HashMap<String,Vector<PropertyInfo>> fRoles
           
protected  HashMap<String,Element> fSchemas
          Hash table for all root schema packages
protected  HashMap<String,String> fStereotypes
          Hash table for all relevant stereotypes
protected  HashMap<String,HashSet<String>> fSubtypes
          Hash table for all relevant subtypes of a pure abstract class
protected  HashMap<String,HashSet<String>> fSupertypes
          Hash table for all relevant supertypes of a feature or data type
protected  HashMap<String,String> fTaggedValues
          Hash table for all relevant tagged values
protected  HashMap<String,Element> fTypes
          Hash table for all potential types
protected  HashMap<String,UUID> fUUIDs
          Hash table for all package uuids
protected  int globalSequenceNumber
          global sequence number to ensure uniqueness in case the required tagged values "sequenceNumber" are not provided; this assumes that in the application schema only non-negative sequence numbers are used
 Options options
           
 ShapeChangeResult result
           
 
Fields inherited from class de.interactive_instruments.ShapeChange.Model.ModelImpl
allowedTags, gmlTags, jsonTags, postprocessed, shapeChangeTags
 
Constructor Summary
Xmi10Document()
           
 
Method Summary
protected  String attributeOfProperty(Element elmt, String child, String att)
          Get value of attribute node.
protected  Multiplicity cardinalityFromString(String multiplicityRanges)
           
 String characterEncoding()
           
 ClassInfo classById(String id)
           
 ClassInfo classByName(String nam)
           
 HashSet<ClassInfo> classes(PackageInfo pi)
          Return all ClassInfo objects contained in the given package and in sub- packages, which belong to the same targetNamespace as the given package.
protected  void cleanupDOM()
          Delete parts of the DOM not relevant for the conversion, i.e. the and the elements.
protected  Element elementOfProperty(Element elmt, String child)
          Get element representing a property.
protected  Element firstChildElement(Element elmt)
          Get first child element.
protected  Element getElementById(String id)
          Get element representing a property.
protected  Vector<String> getOwnerId(Element e)
          Some applications use ownedElement to attach stereotypes
protected  String getOwnerIdAsString(Element e)
          Get the id of the containing package of a class
protected  String idOfProperty(Element elmt, String child)
          Get id (or idref) of an element.
protected  String idrefValue(Node n)
          get value of idref reference
protected  Vector<String> idsOfProperty(Element elmt, String child)
          Get ids (or idrefs) of an element.
protected  void initAssociations()
          Initialize map of asscoiations
protected  void initClasses()
          Process all classes and generate the XML Schema "code"
 void initialise(ShapeChangeResult r, Options o, String xmifile)
          Load the application schema(s).
protected  void initPackages()
          Process all packages in the application schema
protected  void initStereotypesMap()
          Initialize map of well-known stereotypes
protected  void initSubSupertypesMap()
          Initialize maps for supertypes of a feature or data type and subtypes of a pure abstract class
protected  void initTaggedValuesMap()
          Initialize map for well-known tagged values
protected  void initTypesMap()
          Initialize map of types
protected  boolean isOwnerOfEnumeration(Element elmt)
          Needed for MagicDraw XMI 1.0 / UML 1.4 export
protected  boolean notAReference(Element e)
          Verify that an element is a model element and not just a reference to one.
 void open(String xmlfile)
           
 Options options()
          Return options and configuration object.
 PackageInfo packageById(String id)
           
 HashSet<PackageInfo> packages()
           
 ShapeChangeResult result()
          Return result object for error reporting.
 HashSet<PackageInfo> schemas(String name)
          Collect and return all PackageInfo objects tagged as being a schema.
 void shutdown()
           
 String taggedValue(String idref, String tag)
          Find tagged value for a node
 HashMap<String,String> taggedValues(String idref)
           
protected  String textOfProperty(Element e, String property)
          Get value of text node.
protected  String textValue(Node n)
          get value of text child node
 int type()
           
protected  void verify()
          Verify XMI version
protected  boolean visible(Element e)
          Check visibility of an UML model element for the mapping.
 
Methods inherited from class de.interactive_instruments.ShapeChange.Model.ModelImpl
initialise, normalizeTaggedValue, postprocessAfterLoadingAndValidate, selectedSchemas
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.interactive_instruments.ShapeChange.Model.Model
initialise, postprocessAfterLoadingAndValidate, selectedSchemas
 

Field Detail

document

public Document document

dtd

protected String dtd

result

public ShapeChangeResult result

options

public Options options

fTaggedValues

protected HashMap<String,String> fTaggedValues
Hash table for all relevant tagged values


fStereotypes

protected HashMap<String,String> fStereotypes
Hash table for all relevant stereotypes


fSupertypes

protected HashMap<String,HashSet<String>> fSupertypes
Hash table for all relevant supertypes of a feature or data type


fSubtypes

protected HashMap<String,HashSet<String>> fSubtypes
Hash table for all relevant subtypes of a pure abstract class


fTypes

protected HashMap<String,Element> fTypes
Hash table for all potential types


fSchemas

protected HashMap<String,Element> fSchemas
Hash table for all root schema packages


fAssociations

protected HashMap<String,AssociationInfo> fAssociations
Hash table for associations


fRoles

protected HashMap<String,Vector<PropertyInfo>> fRoles

fPackages

protected HashMap<String,PackageInfo> fPackages
Hash table for all relevant packages


fClasses

protected HashMap<String,ClassInfo> fClasses
Hash table for all classes and classnames


fClassnames

protected HashMap<String,ClassInfo> fClassnames

fClassesRoseHiddenCardinality

protected HashMap<String,Multiplicity> fClassesRoseHiddenCardinality

fClassesRoseHiddenLabels

public HashMap<String,String> fClassesRoseHiddenLabels

fUUIDs

protected HashMap<String,UUID> fUUIDs
Hash table for all package uuids


globalSequenceNumber

protected int globalSequenceNumber
global sequence number to ensure uniqueness in case the required tagged values "sequenceNumber" are not provided; this assumes that in the application schema only non-negative sequence numbers are used

Constructor Detail

Xmi10Document

public Xmi10Document()
Method Detail

options

public Options options()
Return options and configuration object.

Specified by:
options in interface Model

result

public ShapeChangeResult result()
Return result object for error reporting.

Specified by:
result in interface Model

initialise

public void initialise(ShapeChangeResult r,
                       Options o,
                       String xmifile)
                throws ShapeChangeAbortException
Load the application schema(s).

Specified by:
initialise in interface Model
Throws:
ShapeChangeAbortException

open

public void open(String xmlfile)
          throws ShapeChangeAbortException
Throws:
ShapeChangeAbortException

characterEncoding

public String characterEncoding()
Specified by:
characterEncoding in interface Model

textValue

protected String textValue(Node n)
get value of text child node


verify

protected void verify()
               throws ShapeChangeAbortException
Verify XMI version

Throws:
ShapeChangeAbortException

cleanupDOM

protected void cleanupDOM()
Delete parts of the DOM not relevant for the conversion, i.e. the and the elements.


idrefValue

protected String idrefValue(Node n)
get value of idref reference


getElementById

protected Element getElementById(String id)
Get element representing a property.


idOfProperty

protected String idOfProperty(Element elmt,
                              String child)
Get id (or idref) of an element.


elementOfProperty

protected Element elementOfProperty(Element elmt,
                                    String child)
Get element representing a property.


idsOfProperty

protected Vector<String> idsOfProperty(Element elmt,
                                       String child)
Get ids (or idrefs) of an element.


textOfProperty

protected String textOfProperty(Element e,
                                String property)
Get value of text node.


attributeOfProperty

protected String attributeOfProperty(Element elmt,
                                     String child,
                                     String att)
Get value of attribute node.


firstChildElement

protected Element firstChildElement(Element elmt)
Get first child element.


visible

protected boolean visible(Element e)
Check visibility of an UML model element for the mapping.


taggedValue

public String taggedValue(String idref,
                          String tag)
Find tagged value for a node


taggedValues

public HashMap<String,String> taggedValues(String idref)
Parameters:
idref - identifies a model element
Returns:
the tagged values for the model element identified by idref

getOwnerId

protected Vector<String> getOwnerId(Element e)
Some applications use ownedElement to attach stereotypes


getOwnerIdAsString

protected String getOwnerIdAsString(Element e)
Get the id of the containing package of a class


notAReference

protected boolean notAReference(Element e)
Verify that an element is a model element and not just a reference to one.


isOwnerOfEnumeration

protected boolean isOwnerOfEnumeration(Element elmt)
Needed for MagicDraw XMI 1.0 / UML 1.4 export


initTaggedValuesMap

protected void initTaggedValuesMap()
Initialize map for well-known tagged values


initStereotypesMap

protected void initStereotypesMap()
Initialize map of well-known stereotypes


initSubSupertypesMap

protected void initSubSupertypesMap()
Initialize maps for supertypes of a feature or data type and subtypes of a pure abstract class


initTypesMap

protected void initTypesMap()
                     throws ShapeChangeAbortException
Initialize map of types

Throws:
ShapeChangeAbortException

initAssociations

protected void initAssociations()
                         throws ShapeChangeAbortException
Initialize map of asscoiations

Throws:
ShapeChangeAbortException

initPackages

protected void initPackages()
                     throws ShapeChangeAbortException
Process all packages in the application schema

Throws:
ShapeChangeAbortException

initClasses

protected void initClasses()
                    throws ShapeChangeAbortException
Process all classes and generate the XML Schema "code"

Throws:
ShapeChangeAbortException

schemas

public HashSet<PackageInfo> schemas(String name)
Description copied from interface: Model
Collect and return all PackageInfo objects tagged as being a schema. If a name is given, only the package with the specified name will be considered.

Specified by:
schemas in interface Model

packageById

public PackageInfo packageById(String id)
Specified by:
packageById in interface Model

classById

public ClassInfo classById(String id)
Specified by:
classById in interface Model

classByName

public ClassInfo classByName(String nam)
Specified by:
classByName in interface Model

classes

public HashSet<ClassInfo> classes(PackageInfo pi)
Description copied from interface: Model
Return all ClassInfo objects contained in the given package and in sub- packages, which belong to the same targetNamespace as the given package.

Specified by:
classes in interface Model

cardinalityFromString

protected Multiplicity cardinalityFromString(String multiplicityRanges)

type

public int type()
Specified by:
type in interface Model

shutdown

public void shutdown()
Specified by:
shutdown in interface Model

packages

public HashSet<PackageInfo> packages()
Specified by:
packages in interface Model
Returns:
all PackageInfo objects contained in the model


Copyright © 2015. All rights reserved.