|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.uml2.common.util.UML2Util
org.eclipse.uml2.uml.util.UMLUtil
Utilities for working with UML elements and resources.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String OPTION__DISCARD
public static final String OPTION__IGNORE
public static final String OPTION__PROCESS
public static final String OPTION__REPORT
protected static final String ANNOTATION__DUPLICATES
protected static final String ANNOTATION__REDEFINES
protected static final String ANNOTATION__SUBSETS
protected static final String ANNOTATION__UNION
protected static final String ENUMERATION_LITERAL__ATTRIBUTE
protected static final String ENUMERATION_LITERAL__ATTRIBUTE_WILDCARD
protected static final String ENUMERATION_LITERAL__ELEMENT
protected static final String ENUMERATION_LITERAL__ELEMENT_ONLY
protected static final String ENUMERATION_LITERAL__ELEMENT_WILDCARD
protected static final String ENUMERATION_LITERAL__EMPTY
protected static final String ENUMERATION_LITERAL__GROUP
protected static final String ENUMERATION_LITERAL__MIXED
protected static final String ENUMERATION_LITERAL__NONE
protected static final String ENUMERATION_LITERAL__SIMPLE
protected static final String ENUMERATION_LITERAL__READ_ONLY
protected static final String ENUMERATION_LITERAL__READ_ONLY_UNSETTABLE
protected static final String ENUMERATION_LITERAL__READ_WRITE
protected static final String ENUMERATION_LITERAL__READ_WRITE_UNSETTABLE
protected static final String ENUMERATION_LITERAL__UNSPECIFIED
protected static final String ENUMERATION__CONTENT_KIND
protected static final String ENUMERATION__FEATURE_KIND
protected static final String ENUMERATION__VISIBILITY_KIND
public static final String STEREOTYPE__E_ATTRIBUTE
public static final String STEREOTYPE__E_CLASS
public static final String STEREOTYPE__E_DATA_TYPE
public static final String STEREOTYPE__E_ENUM
public static final String STEREOTYPE__E_ENUM_LITERAL
public static final String STEREOTYPE__E_OPERATION
public static final String STEREOTYPE__E_PACKAGE
public static final String STEREOTYPE__E_PARAMETER
public static final String STEREOTYPE__E_REFERENCE
public static final String TAG_DEFINITION__ATTRIBUTE_NAME
public static final String TAG_DEFINITION__BASE_PACKAGE
public static final String TAG_DEFINITION__CLASS_NAME
public static final String TAG_DEFINITION__DATA_TYPE_NAME
public static final String TAG_DEFINITION__ENUM_NAME
public static final String TAG_DEFINITION__ENUM_LITERAL_NAME
public static final String TAG_DEFINITION__INSTANCE_CLASS_NAME
public static final String TAG_DEFINITION__IS_ID
public static final String TAG_DEFINITION__IS_RESOLVE_PROXIES
public static final String TAG_DEFINITION__IS_TRANSIENT
public static final String TAG_DEFINITION__IS_UNSETTABLE
public static final String TAG_DEFINITION__IS_VOLATILE
public static final String TAG_DEFINITION__NS_PREFIX
public static final String TAG_DEFINITION__NS_URI
public static final String TAG_DEFINITION__OPERATION_NAME
public static final String TAG_DEFINITION__PACKAGE_NAME
public static final String TAG_DEFINITION__PARAMETER_NAME
public static final String TAG_DEFINITION__PREFIX
public static final String TAG_DEFINITION__REFERENCE_NAME
public static final String TAG_DEFINITION__VISIBILITY
public static final String TAG_DEFINITION__XML_CONTENT_KIND
public static final String TAG_DEFINITION__XML_FEATURE_KIND
public static final String TAG_DEFINITION__XML_NAME
public static final String TAG_DEFINITION__XML_NAMESPACE
Constructor Detail |
public UMLUtil()
Method Detail |
public static String getQualifiedText(EObject eObject)
eObject
- The object for which to retrieve qualified text.
protected static String getQualifiedName(NamedElement namedElement, String separator)
public static Collection findNamedElements(ResourceSet resourceSet, String qualifiedName)
resourceSet
- The resource set in which to search.qualifiedName
- The qualified name of the element(s) to be found.
public static Collection findNamedElements(ResourceSet resourceSet, String qualifiedName, boolean ignoreCase)
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.
public static Collection findNamedElements(ResourceSet resourceSet, String qualifiedName, boolean ignoreCase, EClass eClass)
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.
public static Collection findNamedElements(Resource resource, String qualifiedName)
resource
- The resource in which to search.qualifiedName
- The qualified name of the element(s) to be found.
public static Collection findNamedElements(Resource resource, String qualifiedName, boolean ignoreCase)
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.
public static Collection findNamedElements(Resource resource, String qualifiedName, boolean ignoreCase, EClass eClass)
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.
protected static Collection findNamedElements(Collection eObjects, String qualifiedName, boolean ignoreCase, EClass eClass, Collection namedElements)
public static Profile getProfile(EPackage definition)
definition
- The package.
protected static EClassifier getEClassifier(Class metaclass)
protected static NamedElement getNamedElement(ENamedElement definition)
protected static Stereotype getStereotype(EClass definition)
public static Stereotype getStereotype(EObject stereotypeApplication)
stereotypeApplication
- The object.
public static Element getBaseElement(EObject stereotypeApplication)
stereotypeApplication
- The stereotype application.
public static void setBaseElement(EObject stereotypeApplication, Element element)
stereotypeApplication
- The stereotype application.element
- The new base element.protected static EObject applyStereotype(Element element, EClass definition)
public static EObject safeApplyStereotype(Element element, Stereotype stereotype)
element
- The element to which to apply the stereotype.stereotype
- The stereotype to apply.
protected static Property getTagDefinition(Stereotype stereotype, String propertyName)
protected static Object getTaggedValue(Element element, String qualifiedStereotypeName, String propertyName)
public static boolean setTaggedValue(Element element, Stereotype stereotype, String propertyName, Object value)
element
- The element to which the stereotype is applied.stereotype
- The stereotype.propertyName
- The name of the stereotype property.value
- The new value.
true
if the value was successfully set;
false
otherwise.protected static EList getOwnedAttributes(Type type)
protected static EList getOwnedOperations(Type type)
protected static EList getRedefinedFeatures(Feature feature)
protected static boolean isRedefinitionValid(Feature redefiningFeature, Feature redefinedFeature)
protected static Collection findValidRedefinitions(Feature redefiningFeature, String name)
protected static Collection findValidRedefinitions(Collection redefinedFeatures, Feature redefiningFeature, String name, Classifier redefinitionContext)
protected static boolean isSubsetValid(Property subsettingProperty, Property subsettedProperty)
protected static Collection findValidSubsets(Property subsettingProperty, String name)
protected static Collection findValidSubsets(Collection subsettedProperties, Property subsettingProperty, String name, Classifier subsettingContext)
public static void merge(Package package_, Map options)
OPTION__IGNORE
.
package_
- The receiving package.options
- The options to use.public static void merge(Package package_, Map options, DiagnosticChain diagnostics, Map context)
OPTION__REPORT
.
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.public static Collection convertToEcore(Package package_, Map options)
OPTION__IGNORE
.
package_
- The package to convert.options
- The options to use.
public static Collection convertToEcore(Package package_, Map options, DiagnosticChain diagnostics, Map context)
OPTION__REPORT
.
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.
public static Collection convertToEcore(Profile profile, Map options)
OPTION__IGNORE
.
profile
- The profile to convert.options
- The options to use.
public static Collection convertToEcore(Profile profile, Map options, DiagnosticChain diagnostics, Map context)
OPTION__REPORT
.
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.
public static Collection convertFromEcore(EPackage ePackage, Map options)
ePackage
- The Ecore package to convert.options
- The options to use.
public static Collection convertFromEcore(EPackage ePackage, Map options, DiagnosticChain diagnostics, Map context)
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.
|
Copyright 2003, 2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |