de.armax.ax.devtools.uml
Class AXmodelBundle

java.lang.Object
  extended byde.armax.ax.devtools.uml.AXmodelElementAbstract
      extended byde.armax.ax.devtools.uml.AXmodelBundle
All Implemented Interfaces:
AXmodel, AXmodelElement, AXpackage

public class AXmodelBundle
extends AXmodelElementAbstract
implements AXmodel

This class represents a bundle consisting of several models that may reference each other using a specific stereotype.

An AXmodelBundle is itself an AXmodel.

Author:
Peter Wieland, ARMAX mindware GmbH

Field Summary
 
Fields inherited from interface de.armax.ax.devtools.uml.AXmodel
INTERFACE
 
Constructor Summary
AXmodelBundle(java.io.InputStream[] xmiStreams)
          Instantiates a model bundle using the given xmi input streams and the default stereotype name ("reference")
AXmodelBundle(java.io.InputStream[] xmiStreams, java.lang.String referenceTypeStereotype)
          Constructor taking an array of XMI input streams and a stereotype name that should be used for reference classifiers.
AXmodelBundle(java.lang.String[] xmiFiles)
          Instantiates a model bundle using the given xmi files and the default stereotype name ("reference")
AXmodelBundle(java.lang.String[] xmiFiles, java.lang.String referenceTypeStereotype)
          Constructor taking an array of XMI files and a stereotype name that should be used for reference classifiers.
 
Method Summary
 void dispose()
          Dispose the model.
 boolean existTaggedValue(java.lang.String tag)
          Check weather a tagged value with the given tag name exists.
 AXmodel getModel()
          Get the model containing this element.
 AXmodelBundle getModelBundle()
          Get this models model bundle.
 java.lang.String getModelName()
          Get the name of the model
 AXmodel[] getModels()
          Returns an array containing all models contained in this bundle.
 java.lang.String getName()
          Get the name for the model element.
 java.lang.String getNamespaceName()
          Get the namespace name for this model element.
 java.util.List getOwnedElements()
          Get a list of owned elements of this model.
 java.lang.String getOwnedElementsMethodName()
          Get the method name that returns owned elements of a wrapped namespace object.
 AXpackage getPackage(java.lang.String packageName)
          Get a package of a given name.
 AXpackage getParent()
          Get the parent package of this package.
 AXclassifier getRealClassifier(AXclassifier dummyClassifier)
          Get the "real" classifier for a reference classifier.
 java.lang.Object getRealElement()
          Get the real element, this element wraps.
 java.lang.Object getRealModel()
          Get the object this model wraps
 java.util.Collection getRealOwnedElements()
          Get a list of owned elements of the wrapped model object.
 java.lang.String getReferenceTypeStereoType()
          Returns the stereotype used by this model bundle to identify reference types pointing to real types in another model
 java.lang.String getStereotype()
          Get the stereotype of this element.
 java.util.List getSubPackages()
          Get all packages this package contains.
 java.lang.String getTaggedValue(java.lang.String tag)
          Get a tagged value for a given tag name.
 java.lang.String getTaggedValue(java.lang.String tag, java.lang.String dflt)
          Get a tagged value for a given tag name.
 java.util.List getTaggedValues(java.lang.String tag)
          Get all tagged values for a given tag name.
 java.util.List getTaggedValueTags()
          Get all existing tag names of tagged values for this element.
 boolean isRootPackage()
          Check weather this is a root package.
 void setModelBundle(AXmodelBundle bundle)
          WARNING: Nesting bundles is not supported.
 
Methods inherited from class de.armax.ax.devtools.uml.AXmodelElementAbstract
equals, getNameForCollectionDefine, getNameForCollectionMethod, getNameForCollectionVariable, getNameForDefine, getNameForMethod, getNameForVariable, getPackage, getQualifiedName, getSufficientlyQualifiedName, getSufficientlyQualifiedName, getWellKnownPackages, hasStereotype, isSameNamespace, isSameNamespace, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.armax.ax.devtools.uml.AXmodelElement
equals, getNameForCollectionDefine, getNameForCollectionMethod, getNameForCollectionVariable, getNameForDefine, getNameForMethod, getNameForVariable, getPackage, getQualifiedName, getSufficientlyQualifiedName, getSufficientlyQualifiedName, getWellKnownPackages, hasStereotype, isSameNamespace, isSameNamespace
 

Constructor Detail

AXmodelBundle

public AXmodelBundle(java.lang.String[] xmiFiles,
                     java.lang.String referenceTypeStereotype)
              throws java.io.IOException,
                     AXmodelException

Constructor taking an array of XMI files and a stereotype name that should be used for reference classifiers.

For each XMI file, an AXmodel will be instantiated using AXmodelFactory.getModel(String).

Parameters:
xmiFiles - the model files
referenceTypeStereotype - the stereotype used to mark classifiers as references on other models.
Throws:
java.io.IOException - if a io exception occurs reading the files
AXmodelException - if model instantiation fails

AXmodelBundle

public AXmodelBundle(java.lang.String[] xmiFiles)
              throws java.io.IOException,
                     AXmodelException

Instantiates a model bundle using the given xmi files and the default stereotype name ("reference")

Parameters:
xmiFiles - the model files
Throws:
java.io.IOException - if a io exception occurs reading the files
AXmodelException - if model instantiation fails

AXmodelBundle

public AXmodelBundle(java.io.InputStream[] xmiStreams,
                     java.lang.String referenceTypeStereotype)
              throws java.io.IOException,
                     AXmodelException

Constructor taking an array of XMI input streams and a stereotype name that should be used for reference classifiers.

For each XMI intput stream, an AXmodel will be instantiated using AXmodelFactory.getModel(InputStream).

Parameters:
xmiStreams - the model input streams
referenceTypeStereotype - the stereotype used to mark classifiers as references on other models.
Throws:
java.io.IOException - if a io exception occurs reading the streams
AXmodelException - if model instantiation fails

AXmodelBundle

public AXmodelBundle(java.io.InputStream[] xmiStreams)
              throws java.io.IOException,
                     AXmodelException

Instantiates a model bundle using the given xmi input streams and the default stereotype name ("reference")

Parameters:
xmiStreams - the model input streams
Throws:
java.io.IOException - if a io exception occurs reading the streams
AXmodelException - if model instantiation fails
Method Detail

getReferenceTypeStereoType

public java.lang.String getReferenceTypeStereoType()

Returns the stereotype used by this model bundle to identify reference types pointing to real types in another model


getModels

public AXmodel[] getModels()

Returns an array containing all models contained in this bundle.


getRealClassifier

public AXclassifier getRealClassifier(AXclassifier dummyClassifier)
                               throws AXmodelException

Get the "real" classifier for a reference classifier.

This looks for a classifier with the same qualified name as the dummyClassifiers qualified name in any model that is not the dummy classifiers model.

The first match that is not marked as a reference type is returned.

Parameters:
dummyClassifier - The reference classifier to search the real classifier for
Returns:
the real classifier
Throws:
AXmodelException - if no real classifier exists for the reference classifier

dispose

public void dispose()
Description copied from interface: AXmodel

Dispose the model. Do any required cleanup here.

Specified by:
dispose in interface AXmodel

getName

public java.lang.String getName()
Description copied from interface: AXmodelElement

Get the name for the model element.

Specified by:
getName in interface AXmodelElement
Specified by:
getName in class AXmodelElementAbstract

getNamespaceName

public java.lang.String getNamespaceName()
Description copied from interface: AXmodelElement

Get the namespace name for this model element.

This includes the names of all nested UML namespaces separated by dots (as it is well known for java packages).

Specified by:
getNamespaceName in interface AXmodelElement
Specified by:
getNamespaceName in class AXmodelElementAbstract
Returns:
an empty String

getTaggedValue

public java.lang.String getTaggedValue(java.lang.String tag)
Description copied from interface: AXmodelElement

Get a tagged value for a given tag name.

If more than one tagged value with the same tag name exist for this model element, the first one is returned

Specified by:
getTaggedValue in interface AXmodelElement
Specified by:
getTaggedValue in class AXmodelElementAbstract

getTaggedValue

public java.lang.String getTaggedValue(java.lang.String tag,
                                       java.lang.String dflt)
Description copied from interface: AXmodelElement

Get a tagged value for a given tag name.

If no such tagged value exists, the default value is returned.

If more than one tagged value with the same tag name exist for this model element, the first one is returned

Specified by:
getTaggedValue in interface AXmodelElement
Specified by:
getTaggedValue in class AXmodelElementAbstract

getTaggedValues

public java.util.List getTaggedValues(java.lang.String tag)
Description copied from interface: AXmodelElement

Get all tagged values for a given tag name.

Specified by:
getTaggedValues in interface AXmodelElement
Specified by:
getTaggedValues in class AXmodelElementAbstract

getTaggedValueTags

public java.util.List getTaggedValueTags()
Description copied from interface: AXmodelElement

Get all existing tag names of tagged values for this element.

Specified by:
getTaggedValueTags in interface AXmodelElement
Specified by:
getTaggedValueTags in class AXmodelElementAbstract

existTaggedValue

public boolean existTaggedValue(java.lang.String tag)
Description copied from interface: AXmodelElement

Check weather a tagged value with the given tag name exists.

Specified by:
existTaggedValue in interface AXmodelElement
Specified by:
existTaggedValue in class AXmodelElementAbstract

getModel

public AXmodel getModel()
Description copied from interface: AXmodelElement

Get the model containing this element.

Specified by:
getModel in interface AXmodelElement
Specified by:
getModel in class AXmodelElementAbstract

getRealElement

public java.lang.Object getRealElement()
Description copied from interface: AXmodelElement

Get the real element, this element wraps.

Specified by:
getRealElement in interface AXmodelElement
Specified by:
getRealElement in class AXmodelElementAbstract
Returns:
null - a model bundle has no real element

getStereotype

public java.lang.String getStereotype()
Description copied from interface: AXmodelElement

Get the stereotype of this element.

Specified by:
getStereotype in interface AXmodelElement
Specified by:
getStereotype in class AXmodelElementAbstract

setModelBundle

public void setModelBundle(AXmodelBundle bundle)

WARNING: Nesting bundles is not supported.

This method is not implemented and any calls will be ignored.

Specified by:
setModelBundle in interface AXmodel
Parameters:
bundle -

getModelBundle

public AXmodelBundle getModelBundle()
Description copied from interface: AXmodel

Get this models model bundle.

Specified by:
getModelBundle in interface AXmodel
Returns:
this model bundle
See Also:
AXmodel.setModelBundle(AXmodelBundle)

getRealModel

public java.lang.Object getRealModel()
Description copied from interface: AXmodel

Get the object this model wraps

Specified by:
getRealModel in interface AXmodel
Returns:
null - a model bundle has no real model

getModelName

public java.lang.String getModelName()
Description copied from interface: AXmodel

Get the name of the model

Specified by:
getModelName in interface AXmodel

getPackage

public AXpackage getPackage(java.lang.String packageName)

Get a package of a given name.

This method scans all contained models for the given package and creates a package bundle if necessary.

Specified by:
getPackage in interface AXmodel
Parameters:
packageName - the name of the package to search
Returns:
an instance of AXpackage representing the given package or null if no such package is found

getOwnedElements

public java.util.List getOwnedElements()
Description copied from interface: AXmodel

Get a list of owned elements of this model.

Specified by:
getOwnedElements in interface AXmodel

getRealOwnedElements

public java.util.Collection getRealOwnedElements()
Description copied from interface: AXmodel

Get a list of owned elements of the wrapped model object.

Specified by:
getRealOwnedElements in interface AXmodel

getOwnedElementsMethodName

public java.lang.String getOwnedElementsMethodName()
Description copied from interface: AXmodel

Get the method name that returns owned elements of a wrapped namespace object.

Specified by:
getOwnedElementsMethodName in interface AXmodel

isRootPackage

public boolean isRootPackage()
Description copied from interface: AXpackage

Check weather this is a root package.

A package is considered to be a root package, if there is no other package except the model itself that contains this package (i.e. the namespace is null or empty). The return value of this method for the model package itself is not determined.

Specified by:
isRootPackage in interface AXpackage

getParent

public AXpackage getParent()
Description copied from interface: AXpackage

Get the parent package of this package.

This should never be null except for the model itself. The parent package of root packages is the model.

Specified by:
getParent in interface AXpackage

getSubPackages

public java.util.List getSubPackages()
Description copied from interface: AXpackage

Get all packages this package contains.

Specified by:
getSubPackages in interface AXpackage


Copyright © 2003 ARMAX mindware GmbH. All Rights Reserved.