org.eclipse.uml2.uml.util
Class UMLUtil

java.lang.Object
  extended byorg.eclipse.uml2.common.util.UML2Util
      extended byorg.eclipse.uml2.uml.util.UMLUtil

public class UMLUtil
extends UML2Util

Utilities for working with UML elements and resources.

Since:
2.0

Nested Class Summary
static class UMLUtil.Ecore2UMLConverter
          A converter that converts Ecore model elements to representative UML elements.
static class UMLUtil.PackageMerger
          A copier that merges the contents of packages involved in package merge relationships based on the rules defined in the UML specification.
static class UMLUtil.Profile2EPackageConverter
          A converter that converts UML profiles to representative Ecore packages.
static class UMLUtil.QualifiedTextProvider
          A qualified text provider that uses names of named elements as qualified text segments and :: as a separator.
static class UMLUtil.UML2EcoreConverter
          A converter that converts UML elements to representative Ecore model elements.
 
Nested classes inherited from class org.eclipse.uml2.common.util.UML2Util
UML2Util.Converter, UML2Util.EClassMatcher, UML2Util.EObjectMatcher, UML2Util.EStructuralFeatureMatcher
 
Field Summary
protected static String ANNOTATION__DUPLICATES
           
protected static String ANNOTATION__REDEFINES
           
protected static String ANNOTATION__SUBSETS
           
protected static String ANNOTATION__UNION
           
protected static String ENUMERATION__CONTENT_KIND
           
protected static String ENUMERATION__FEATURE_KIND
           
protected static String ENUMERATION__VISIBILITY_KIND
           
protected static String ENUMERATION_LITERAL__ATTRIBUTE
           
protected static String ENUMERATION_LITERAL__ATTRIBUTE_WILDCARD
           
protected static String ENUMERATION_LITERAL__ELEMENT
           
protected static String ENUMERATION_LITERAL__ELEMENT_ONLY
           
protected static String ENUMERATION_LITERAL__ELEMENT_WILDCARD
           
protected static String ENUMERATION_LITERAL__EMPTY
           
protected static String ENUMERATION_LITERAL__GROUP
           
protected static String ENUMERATION_LITERAL__MIXED
           
protected static String ENUMERATION_LITERAL__NONE
           
protected static String ENUMERATION_LITERAL__READ_ONLY
           
protected static String ENUMERATION_LITERAL__READ_ONLY_UNSETTABLE
           
protected static String ENUMERATION_LITERAL__READ_WRITE
           
protected static String ENUMERATION_LITERAL__READ_WRITE_UNSETTABLE
           
protected static String ENUMERATION_LITERAL__SIMPLE
           
protected static String ENUMERATION_LITERAL__UNSPECIFIED
           
static String OPTION__DISCARD
          Represents an option choice of 'discard'.
static String OPTION__IGNORE
          Represents an option choice of 'ignore'.
static String OPTION__PROCESS
          Represents an option choice of 'process'.
static String OPTION__REPORT
          Represents an option choice of 'report'.
static String STEREOTYPE__E_ATTRIBUTE
          The name of the 'EAttribute' stereotype.
static String STEREOTYPE__E_CLASS
          The name of the 'EClass' stereotype.
static String STEREOTYPE__E_DATA_TYPE
          The name of the 'EDataType' stereotype.
static String STEREOTYPE__E_ENUM
          The name of the 'EEnum' stereotype.
static String STEREOTYPE__E_ENUM_LITERAL
          The name of the 'EEnumLiteral' stereotype.
static String STEREOTYPE__E_OPERATION
          The name of the 'EOperation' stereotype.
static String STEREOTYPE__E_PACKAGE
          The name of the 'EPackage' stereotype.
static String STEREOTYPE__E_PARAMETER
          The name of the 'EParameter' stereotype.
static String STEREOTYPE__E_REFERENCE
          The name of the 'EReference' stereotype.
static String TAG_DEFINITION__ATTRIBUTE_NAME
          The name of the 'attributeName' stereotype property.
static String TAG_DEFINITION__BASE_PACKAGE
          The name of the 'basePackage' stereotype property.
static String TAG_DEFINITION__CLASS_NAME
          The name of the 'className' stereotype property.
static String TAG_DEFINITION__DATA_TYPE_NAME
          The name of the 'dataTypeName' stereotype property.
static String TAG_DEFINITION__ENUM_LITERAL_NAME
          The name of the 'enumLiteralName' stereotype property.
static String TAG_DEFINITION__ENUM_NAME
          The name of the 'enumName' stereotype property.
static String TAG_DEFINITION__INSTANCE_CLASS_NAME
          The name of the 'instanceClassName' stereotype property.
static String TAG_DEFINITION__IS_ID
          The name of the 'isID' stereotype property.
static String TAG_DEFINITION__IS_RESOLVE_PROXIES
          The name of the 'isResolveProxies' stereotype property.
static String TAG_DEFINITION__IS_TRANSIENT
          The name of the 'isTransient' stereotype property.
static String TAG_DEFINITION__IS_UNSETTABLE
          The name of the 'isUnsettable' stereotype property.
static String TAG_DEFINITION__IS_VOLATILE
          The name of the 'isVolatile' stereotype property.
static String TAG_DEFINITION__NS_PREFIX
          The name of the 'nsPrefix' stereotype property.
static String TAG_DEFINITION__NS_URI
          The name of the 'nsURI' stereotype property.
static String TAG_DEFINITION__OPERATION_NAME
          The name of the 'operationName' stereotype property.
static String TAG_DEFINITION__PACKAGE_NAME
          The name of the 'packageName' stereotype property.
static String TAG_DEFINITION__PARAMETER_NAME
          The name of the 'parameterName' stereotype property.
static String TAG_DEFINITION__PREFIX
          The name of the 'prefix' stereotype property.
static String TAG_DEFINITION__REFERENCE_NAME
          The name of the 'referenceName' stereotype property.
static String TAG_DEFINITION__VISIBILITY
          The name of the 'visibility' stereotype property.
static String TAG_DEFINITION__XML_CONTENT_KIND
          The name of the 'xmlContentKind' stereotype property.
static String TAG_DEFINITION__XML_FEATURE_KIND
          The name of the 'xmlFeatureKind' stereotype property.
static String TAG_DEFINITION__XML_NAME
          The name of the 'xmlName' stereotype property.
static String TAG_DEFINITION__XML_NAMESPACE
          The name of the 'xmlNamespace' stereotype property.
 
Fields inherited from class org.eclipse.uml2.common.util.UML2Util
DEFAULT_URI_CONVERTER, EMPTY_STRING, LINE_SEPARATOR, PROPERTIES_FILE_EXTENSION, RESOURCE_BUNDLES, URI_SCHEME_PLATFORM, URI_SEGMENT_PLUGIN, URI_SEGMENT_RESOURCE
 
Constructor Summary
UMLUtil()
           
 
Method Summary
protected static EObject applyStereotype(Element element, EClass definition)
           
static Collection convertFromEcore(EPackage ePackage, Map options)
          Converts the specified Ecore package (and its contents) to UML using the specified options.
static Collection convertFromEcore(EPackage ePackage, Map options, DiagnosticChain diagnostics, Map context)
          Converts the specified Ecore package (and its contents) to UML using the specified options, reporting problems to the specified diagnostics, within the specified context.
static Collection convertToEcore(Package package_, Map options)
          Converts the specified package (and its contents) to Ecore using the specified options.
static Collection convertToEcore(Package package_, Map options, DiagnosticChain diagnostics, Map context)
          Converts the specified package (and its contents) to Ecore using the specified options, reporting problems to the specified diagnostics, within the specified context.
static Collection convertToEcore(Profile profile, Map options)
          Converts the specified profile (and its contents) to Ecore using the specified options.
static Collection convertToEcore(Profile profile, Map options, DiagnosticChain diagnostics, Map context)
          Converts the specified profile (and its contents) to Ecore using the specified options, reporting problems to the specified diagnostics, within the specified context.
protected static Collection findNamedElements(Collection eObjects, String qualifiedName, boolean ignoreCase, EClass eClass, Collection namedElements)
           
static Collection findNamedElements(ResourceSet resourceSet, String qualifiedName)
          Retrieves the named element(s) with the specified qualified name from the specified resource set.
static Collection findNamedElements(ResourceSet resourceSet, String qualifiedName, boolean ignoreCase)
          Retrieves the named element(s) with the specified qualified name from the specified resource set, optionally ignoring case when doing name comparisons.
static Collection findNamedElements(ResourceSet resourceSet, String qualifiedName, boolean ignoreCase, EClass eClass)
          Retrieves the named element(s) of the specified type with the specified qualified name from the specified resource set, optionally ignoring case when doing name comparisons.
static Collection findNamedElements(Resource resource, String qualifiedName)
          Retrieves the named element(s) with the specified qualified name from the specified resource.
static Collection findNamedElements(Resource resource, String qualifiedName, boolean ignoreCase)
          Retrieves the named element(s) with the specified qualified name from the specified resource, optionally ignoring case when doing name comparisons.
static Collection findNamedElements(Resource resource, String qualifiedName, boolean ignoreCase, EClass eClass)
          Retrieves the named element(s) of the specified type with the specified qualified name from the specified resource, optionally ignoring case when doing name comparisons.
protected static Collection findValidRedefinitions(Collection redefinedFeatures, Feature redefiningFeature, String name, Classifier redefinitionContext)
           
protected static Collection findValidRedefinitions(Feature redefiningFeature, String name)
           
protected static Collection findValidSubsets(Collection subsettedProperties, Property subsettingProperty, String name, Classifier subsettingContext)
           
protected static Collection findValidSubsets(Property subsettingProperty, String name)
           
static Element getBaseElement(EObject stereotypeApplication)
          Retrieves the base element for the specified stereotype application, i.e.
protected static EClassifier getEClassifier(Class metaclass)
           
protected static NamedElement getNamedElement(ENamedElement definition)
           
protected static EList getOwnedAttributes(Type type)
           
protected static EList getOwnedOperations(Type type)
           
static Profile getProfile(EPackage definition)
          Retrieves the profile for which the specified package represents a definition.
protected static String getQualifiedName(NamedElement namedElement, String separator)
           
static String getQualifiedText(EObject eObject)
          Retrieves a qualified textual representation of the specified object using the default qualified text provider.
protected static EList getRedefinedFeatures(Feature feature)
           
protected static Stereotype getStereotype(EClass definition)
           
static Stereotype getStereotype(EObject stereotypeApplication)
          Retrieves the stereotype for which the specified object represents an application.
protected static Property getTagDefinition(Stereotype stereotype, String propertyName)
           
protected static Object getTaggedValue(Element element, String qualifiedStereotypeName, String propertyName)
           
protected static boolean isRedefinitionValid(Feature redefiningFeature, Feature redefinedFeature)
           
protected static boolean isSubsetValid(Property subsettingProperty, Property subsettedProperty)
           
static void merge(Package package_, Map options)
          Merges the contents of (all of) the packages merged by the specified package using the specified options.
static void merge(Package package_, Map options, DiagnosticChain diagnostics, Map context)
          Merges the contents of (all of) the packages merged by the specified package using the specified options, reporting problems to the specified diagnostics, within the specified context.
static EObject safeApplyStereotype(Element element, Stereotype stereotype)
          Safely applies the specified stereotype to the specified element, i.e.
static void setBaseElement(EObject stereotypeApplication, Element element)
          Sets the base element for the specified stereotype application to the specified element.
static boolean setTaggedValue(Element element, Stereotype stereotype, String propertyName, Object value)
          Sets the value of the specified property of the specified stereotype application on the specified element.
 
Methods inherited from class org.eclipse.uml2.common.util.UML2Util
addConstraint, addDocumentation, createEAnnotation, destroy, destroyAll, findEObject, findEObject, getAllContents, getCommonEType, getEAnnotation, getGreaterUpperBound, getInstanceCount, getInverseReferences, getLesserLowerBound, getMessageSubstitution, getMessageSubstitutions, getMessageSubstitutions, getMessageSubstitutions, getNonNavigableInverseReferences, getQualifiedText, getQualifiedText, getQualifiedTextSegment, getResourceBundle, getResourceBundle, getResourceBundleURIs, getResourceBundleURIs, getRootContainers, getString, getValidJavaIdentifier, getValidJavaIdentifier, getValidNCName, getValidNCName, getXMIIdentifier, getXMIIdentifier, intersect, isEmpty, isNCNamePart, isNCNameStart, load, removeReferences, safeEquals
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION__DISCARD

public static final String OPTION__DISCARD
Represents an option choice of 'discard'.

See Also:
Constant Field Values

OPTION__IGNORE

public static final String OPTION__IGNORE
Represents an option choice of 'ignore'.

See Also:
Constant Field Values

OPTION__PROCESS

public static final String OPTION__PROCESS
Represents an option choice of 'process'.

See Also:
Constant Field Values

OPTION__REPORT

public static final String OPTION__REPORT
Represents an option choice of 'report'.

See Also:
Constant Field Values

ANNOTATION__DUPLICATES

protected static final String ANNOTATION__DUPLICATES
See Also:
Constant Field Values

ANNOTATION__REDEFINES

protected static final String ANNOTATION__REDEFINES
See Also:
Constant Field Values

ANNOTATION__SUBSETS

protected static final String ANNOTATION__SUBSETS
See Also:
Constant Field Values

ANNOTATION__UNION

protected static final String ANNOTATION__UNION
See Also:
Constant Field Values

ENUMERATION_LITERAL__ATTRIBUTE

protected static final String ENUMERATION_LITERAL__ATTRIBUTE
See Also:
Constant Field Values

ENUMERATION_LITERAL__ATTRIBUTE_WILDCARD

protected static final String ENUMERATION_LITERAL__ATTRIBUTE_WILDCARD
See Also:
Constant Field Values

ENUMERATION_LITERAL__ELEMENT

protected static final String ENUMERATION_LITERAL__ELEMENT
See Also:
Constant Field Values

ENUMERATION_LITERAL__ELEMENT_ONLY

protected static final String ENUMERATION_LITERAL__ELEMENT_ONLY
See Also:
Constant Field Values

ENUMERATION_LITERAL__ELEMENT_WILDCARD

protected static final String ENUMERATION_LITERAL__ELEMENT_WILDCARD
See Also:
Constant Field Values

ENUMERATION_LITERAL__EMPTY

protected static final String ENUMERATION_LITERAL__EMPTY
See Also:
Constant Field Values

ENUMERATION_LITERAL__GROUP

protected static final String ENUMERATION_LITERAL__GROUP
See Also:
Constant Field Values

ENUMERATION_LITERAL__MIXED

protected static final String ENUMERATION_LITERAL__MIXED
See Also:
Constant Field Values

ENUMERATION_LITERAL__NONE

protected static final String ENUMERATION_LITERAL__NONE
See Also:
Constant Field Values

ENUMERATION_LITERAL__SIMPLE

protected static final String ENUMERATION_LITERAL__SIMPLE
See Also:
Constant Field Values

ENUMERATION_LITERAL__READ_ONLY

protected static final String ENUMERATION_LITERAL__READ_ONLY
See Also:
Constant Field Values

ENUMERATION_LITERAL__READ_ONLY_UNSETTABLE

protected static final String ENUMERATION_LITERAL__READ_ONLY_UNSETTABLE
See Also:
Constant Field Values

ENUMERATION_LITERAL__READ_WRITE

protected static final String ENUMERATION_LITERAL__READ_WRITE
See Also:
Constant Field Values

ENUMERATION_LITERAL__READ_WRITE_UNSETTABLE

protected static final String ENUMERATION_LITERAL__READ_WRITE_UNSETTABLE
See Also:
Constant Field Values

ENUMERATION_LITERAL__UNSPECIFIED

protected static final String ENUMERATION_LITERAL__UNSPECIFIED
See Also:
Constant Field Values

ENUMERATION__CONTENT_KIND

protected static final String ENUMERATION__CONTENT_KIND
See Also:
Constant Field Values

ENUMERATION__FEATURE_KIND

protected static final String ENUMERATION__FEATURE_KIND
See Also:
Constant Field Values

ENUMERATION__VISIBILITY_KIND

protected static final String ENUMERATION__VISIBILITY_KIND
See Also:
Constant Field Values

STEREOTYPE__E_ATTRIBUTE

public static final String STEREOTYPE__E_ATTRIBUTE
The name of the 'EAttribute' stereotype.

See Also:
Constant Field Values

STEREOTYPE__E_CLASS

public static final String STEREOTYPE__E_CLASS
The name of the 'EClass' stereotype.

See Also:
Constant Field Values

STEREOTYPE__E_DATA_TYPE

public static final String STEREOTYPE__E_DATA_TYPE
The name of the 'EDataType' stereotype.

See Also:
Constant Field Values

STEREOTYPE__E_ENUM

public static final String STEREOTYPE__E_ENUM
The name of the 'EEnum' stereotype.

See Also:
Constant Field Values

STEREOTYPE__E_ENUM_LITERAL

public static final String STEREOTYPE__E_ENUM_LITERAL
The name of the 'EEnumLiteral' stereotype.

See Also:
Constant Field Values

STEREOTYPE__E_OPERATION

public static final String STEREOTYPE__E_OPERATION
The name of the 'EOperation' stereotype.

See Also:
Constant Field Values

STEREOTYPE__E_PACKAGE

public static final String STEREOTYPE__E_PACKAGE
The name of the 'EPackage' stereotype.

See Also:
Constant Field Values

STEREOTYPE__E_PARAMETER

public static final String STEREOTYPE__E_PARAMETER
The name of the 'EParameter' stereotype.

See Also:
Constant Field Values

STEREOTYPE__E_REFERENCE

public static final String STEREOTYPE__E_REFERENCE
The name of the 'EReference' stereotype.

See Also:
Constant Field Values

TAG_DEFINITION__ATTRIBUTE_NAME

public static final String TAG_DEFINITION__ATTRIBUTE_NAME
The name of the 'attributeName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__BASE_PACKAGE

public static final String TAG_DEFINITION__BASE_PACKAGE
The name of the 'basePackage' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__CLASS_NAME

public static final String TAG_DEFINITION__CLASS_NAME
The name of the 'className' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__DATA_TYPE_NAME

public static final String TAG_DEFINITION__DATA_TYPE_NAME
The name of the 'dataTypeName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__ENUM_NAME

public static final String TAG_DEFINITION__ENUM_NAME
The name of the 'enumName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__ENUM_LITERAL_NAME

public static final String TAG_DEFINITION__ENUM_LITERAL_NAME
The name of the 'enumLiteralName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__INSTANCE_CLASS_NAME

public static final String TAG_DEFINITION__INSTANCE_CLASS_NAME
The name of the 'instanceClassName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__IS_ID

public static final String TAG_DEFINITION__IS_ID
The name of the 'isID' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__IS_RESOLVE_PROXIES

public static final String TAG_DEFINITION__IS_RESOLVE_PROXIES
The name of the 'isResolveProxies' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__IS_TRANSIENT

public static final String TAG_DEFINITION__IS_TRANSIENT
The name of the 'isTransient' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__IS_UNSETTABLE

public static final String TAG_DEFINITION__IS_UNSETTABLE
The name of the 'isUnsettable' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__IS_VOLATILE

public static final String TAG_DEFINITION__IS_VOLATILE
The name of the 'isVolatile' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__NS_PREFIX

public static final String TAG_DEFINITION__NS_PREFIX
The name of the 'nsPrefix' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__NS_URI

public static final String TAG_DEFINITION__NS_URI
The name of the 'nsURI' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__OPERATION_NAME

public static final String TAG_DEFINITION__OPERATION_NAME
The name of the 'operationName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__PACKAGE_NAME

public static final String TAG_DEFINITION__PACKAGE_NAME
The name of the 'packageName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__PARAMETER_NAME

public static final String TAG_DEFINITION__PARAMETER_NAME
The name of the 'parameterName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__PREFIX

public static final String TAG_DEFINITION__PREFIX
The name of the 'prefix' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__REFERENCE_NAME

public static final String TAG_DEFINITION__REFERENCE_NAME
The name of the 'referenceName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__VISIBILITY

public static final String TAG_DEFINITION__VISIBILITY
The name of the 'visibility' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__XML_CONTENT_KIND

public static final String TAG_DEFINITION__XML_CONTENT_KIND
The name of the 'xmlContentKind' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__XML_FEATURE_KIND

public static final String TAG_DEFINITION__XML_FEATURE_KIND
The name of the 'xmlFeatureKind' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__XML_NAME

public static final String TAG_DEFINITION__XML_NAME
The name of the 'xmlName' stereotype property.

See Also:
Constant Field Values

TAG_DEFINITION__XML_NAMESPACE

public static final String TAG_DEFINITION__XML_NAMESPACE
The name of the 'xmlNamespace' stereotype property.

See Also:
Constant Field Values
Constructor Detail

UMLUtil

public UMLUtil()
Method Detail

getQualifiedText

public static String getQualifiedText(EObject eObject)
Retrieves a qualified textual representation of the specified object using the default qualified text provider.

Parameters:
eObject - The object for which to retrieve qualified text.
Returns:
A qualified textual representation of the object.

getQualifiedName

protected static String getQualifiedName(NamedElement namedElement,
                                         String separator)

findNamedElements

public static Collection findNamedElements(ResourceSet resourceSet,
                                           String qualifiedName)
Retrieves the named element(s) with the specified qualified name from the specified resource set.

Parameters:
resourceSet - The resource set in which to search.
qualifiedName - The qualified name of the element(s) to be found.
Returns:
The named element(s).

findNamedElements

public static Collection findNamedElements(ResourceSet resourceSet,
                                           String qualifiedName,
                                           boolean ignoreCase)
Retrieves the named element(s) with the specified qualified name from the specified resource set, optionally ignoring case when doing name comparisons.

Parameters:
resourceSet - The resource set in which to search.
qualifiedName - The qualified name of the element(s) to be found.
ignoreCase - Whether to ignore case when doing name comparisons.
Returns:
The named element(s).

findNamedElements

public static Collection findNamedElements(ResourceSet resourceSet,
                                           String qualifiedName,
                                           boolean ignoreCase,
                                           EClass eClass)
Retrieves the named element(s) of the specified type with the specified qualified name from the specified resource set, optionally ignoring case when doing name comparisons.

Parameters:
resourceSet - The resource set in which to search.
qualifiedName - The qualified name of the element(s) to be found.
ignoreCase - Whether to ignore case when doing name comparisons.
eClass - The type of the element(s) to be found.
Returns:
The named element(s).

findNamedElements

public static Collection findNamedElements(Resource resource,
                                           String qualifiedName)
Retrieves the named element(s) with the specified qualified name from the specified resource.

Parameters:
resource - The resource in which to search.
qualifiedName - The qualified name of the element(s) to be found.
Returns:
The named element(s).

findNamedElements

public static Collection findNamedElements(Resource resource,
                                           String qualifiedName,
                                           boolean ignoreCase)
Retrieves the named element(s) with the specified qualified name from the specified resource, optionally ignoring case when doing name comparisons.

Parameters:
resource - The resource in which to search.
qualifiedName - The qualified name of the element(s) to be found.
ignoreCase - Whether to ignore case when doing name comparisons.
Returns:
The named element(s).

findNamedElements

public static Collection findNamedElements(Resource resource,
                                           String qualifiedName,
                                           boolean ignoreCase,
                                           EClass eClass)
Retrieves the named element(s) of the specified type with the specified qualified name from the specified resource, optionally ignoring case when doing name comparisons.

Parameters:
resource - The resource in which to search.
qualifiedName - The qualified name of the element(s) to be found.
ignoreCase - Whether to ignore case when doing name comparisons.
eClass - The type of the element(s) to be found.
Returns:
The named element(s).

findNamedElements

protected static Collection findNamedElements(Collection eObjects,
                                              String qualifiedName,
                                              boolean ignoreCase,
                                              EClass eClass,
                                              Collection namedElements)

getProfile

public static Profile getProfile(EPackage definition)
Retrieves the profile for which the specified package represents a definition.

Parameters:
definition - The package.
Returns:
The profile.

getEClassifier

protected static EClassifier getEClassifier(Class metaclass)

getNamedElement

protected static NamedElement getNamedElement(ENamedElement definition)

getStereotype

protected static Stereotype getStereotype(EClass definition)

getStereotype

public static Stereotype getStereotype(EObject stereotypeApplication)
Retrieves the stereotype for which the specified object represents an application.

Parameters:
stereotypeApplication - The object.
Returns:
The stereotype.

getBaseElement

public static Element getBaseElement(EObject stereotypeApplication)
Retrieves the base element for the specified stereotype application, i.e. the element to which the stereotype is applied.

Parameters:
stereotypeApplication - The stereotype application.
Returns:
The base element.

setBaseElement

public static void setBaseElement(EObject stereotypeApplication,
                                  Element element)
Sets the base element for the specified stereotype application to the specified element.

Parameters:
stereotypeApplication - The stereotype application.
element - The new base element.

applyStereotype

protected static EObject applyStereotype(Element element,
                                         EClass definition)

safeApplyStereotype

public static EObject safeApplyStereotype(Element element,
                                          Stereotype stereotype)
Safely applies the specified stereotype to the specified element, i.e. applies the profile if not already applied.

Parameters:
element - The element to which to apply the stereotype.
stereotype - The stereotype to apply.
Returns:
The stereotype application.

getTagDefinition

protected static Property getTagDefinition(Stereotype stereotype,
                                           String propertyName)

getTaggedValue

protected static Object getTaggedValue(Element element,
                                       String qualifiedStereotypeName,
                                       String propertyName)

setTaggedValue

public static boolean setTaggedValue(Element element,
                                     Stereotype stereotype,
                                     String propertyName,
                                     Object value)
Sets the value of the specified property of the specified stereotype application on the specified element.

Parameters:
element - The element to which the stereotype is applied.
stereotype - The stereotype.
propertyName - The name of the stereotype property.
value - The new value.
Returns:
true if the value was successfully set; false otherwise.

getOwnedAttributes

protected static EList getOwnedAttributes(Type type)

getOwnedOperations

protected static EList getOwnedOperations(Type type)

getRedefinedFeatures

protected static EList getRedefinedFeatures(Feature feature)

isRedefinitionValid

protected static boolean isRedefinitionValid(Feature redefiningFeature,
                                             Feature redefinedFeature)

findValidRedefinitions

protected static Collection findValidRedefinitions(Feature redefiningFeature,
                                                   String name)

findValidRedefinitions

protected static Collection findValidRedefinitions(Collection redefinedFeatures,
                                                   Feature redefiningFeature,
                                                   String name,
                                                   Classifier redefinitionContext)

isSubsetValid

protected static boolean isSubsetValid(Property subsettingProperty,
                                       Property subsettedProperty)

findValidSubsets

protected static Collection findValidSubsets(Property subsettingProperty,
                                             String name)

findValidSubsets

protected static Collection findValidSubsets(Collection subsettedProperties,
                                             Property subsettingProperty,
                                             String name,
                                             Classifier subsettingContext)

merge

public static void merge(Package package_,
                         Map options)
Merges the contents of (all of) the packages merged by the specified package using the specified options. If a supported option is not specified, it will be defaulted to OPTION__IGNORE.

Parameters:
package_ - The receiving package.
options - The options to use.

merge

public static void merge(Package package_,
                         Map options,
                         DiagnosticChain diagnostics,
                         Map context)
Merges the contents of (all of) the packages merged by the specified package using the specified options, reporting problems to the specified diagnostics, within the specified context. If a supported option is not specified, it will be defaulted to OPTION__REPORT.

Parameters:
package_ - The receiving package.
options - The options to use.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

convertToEcore

public static Collection convertToEcore(Package package_,
                                        Map options)
Converts the specified package (and its contents) to Ecore using the specified options. If a supported option is not specified, it will be defaulted to OPTION__IGNORE.

Parameters:
package_ - The package to convert.
options - The options to use.
Returns:
An Ecore representation of the package.

convertToEcore

public static Collection convertToEcore(Package package_,
                                        Map options,
                                        DiagnosticChain diagnostics,
                                        Map context)
Converts the specified package (and its contents) to Ecore using the specified options, reporting problems to the specified diagnostics, within the specified context. If a supported option is not specified, it will be defaulted to OPTION__REPORT.

Parameters:
package_ - The package to convert.
options - The options to use.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.
Returns:
An Ecore representation of the package.

convertToEcore

public static Collection convertToEcore(Profile profile,
                                        Map options)
Converts the specified profile (and its contents) to Ecore using the specified options. If a supported option is not specified, it will be defaulted to OPTION__IGNORE.

Parameters:
profile - The profile to convert.
options - The options to use.
Returns:
An Ecore representation of the profile.

convertToEcore

public static Collection convertToEcore(Profile profile,
                                        Map options,
                                        DiagnosticChain diagnostics,
                                        Map context)
Converts the specified profile (and its contents) to Ecore using the specified options, reporting problems to the specified diagnostics, within the specified context. If a supported option is not specified, it will be defaulted to OPTION__REPORT.

Parameters:
profile - The profile to convert.
options - The options to use.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.
Returns:
An Ecore representation of the profile.

convertFromEcore

public static Collection convertFromEcore(EPackage ePackage,
                                          Map options)
Converts the specified Ecore package (and its contents) to UML using the specified options.

Parameters:
ePackage - The Ecore package to convert.
options - The options to use.
Returns:
A UML representation of the Ecore package.

convertFromEcore

public static Collection convertFromEcore(EPackage ePackage,
                                          Map options,
                                          DiagnosticChain diagnostics,
                                          Map context)
Converts the specified Ecore package (and its contents) to UML using the specified options, reporting problems to the specified diagnostics, within the specified context.

Parameters:
ePackage - The Ecore package to convert.
options - The options to use.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.
Returns:
A UML representation of the Ecore package.

Copyright 2003, 2006 IBM Corporation and others.
All Rights Reserved.