org.eclipse.uml2.util
Class UML2Util
java.lang.Object
org.eclipse.uml2.util.UML2Util
- public class UML2Util
- extends Object
Constructor Summary |
protected |
UML2Util()
|
Method Summary |
protected static void |
addConstraint(EModelElement eModelElement,
String constraint)
|
protected static void |
addDocumentation(EModelElement eModelElement,
String text)
|
protected static StringBuffer |
appendQualifiedText(StringBuffer qualifiedText,
EObject eObject,
UML2Util.QualifiedTextProvider qualifiedTextProvider)
|
protected static StringBuffer |
appendQualifiedTextSegment(StringBuffer qualifiedText,
EObject eObject,
UML2Util.QualifiedTextProvider qualifiedTextProvider)
|
protected static StringBuffer |
appendValidIdentifier(StringBuffer validIdentifier,
String name)
Appends a valid (Java) identifier based on the specified name to the
specified buffer. |
static Collection |
convertFromEcore(EPackage ePackage,
Map options)
|
static Collection |
convertFromEcore(EPackage ePackage,
Map options,
DiagnosticChain diagnostics,
Map context)
|
static Collection |
convertToEcore(Package package_,
Map options)
|
static Collection |
convertToEcore(Package package_,
Map options,
DiagnosticChain diagnostics,
Map context)
|
protected static EAnnotation |
createEAnnotation(EModelElement eModelElement,
String source)
|
static EObject |
findEObject(Collection eObjects,
UML2Util.EObjectMatcher filter)
|
protected static Collection |
findNamedElements(Collection eObjects,
String qualifiedName,
boolean ignoreCase,
EClass eClass,
Collection namedElements)
|
static Collection |
findNamedElements(ResourceSet resourceSet,
String qualifiedName)
|
static Collection |
findNamedElements(ResourceSet resourceSet,
String qualifiedName,
boolean ignoreCase)
|
static Collection |
findNamedElements(ResourceSet resourceSet,
String qualifiedName,
boolean ignoreCase,
EClass eClass)
|
static Collection |
findNamedElements(Resource resource,
String qualifiedName)
|
static Collection |
findNamedElements(Resource resource,
String qualifiedName,
boolean ignoreCase)
|
static Collection |
findNamedElements(Resource resource,
String qualifiedName,
boolean ignoreCase,
EClass eClass)
|
protected static TreeIterator |
getAllContents(EObject eObject,
boolean includeRoot,
boolean defensiveCopy)
|
protected static EClassifier |
getCommonEType(EClassifier eType,
EClassifier otherEType)
|
protected static EAnnotation |
getEAnnotation(EModelElement eModelElement,
String source,
boolean createOnDemand)
|
protected static int |
getGreaterUpperBound(int upperBound,
int otherUpperBound)
|
static int |
getInstanceCount(EObject eObject,
EClassifier eClassifier)
|
static int |
getInstanceCount(Iterator iterator,
EClassifier eClassifier)
|
static int |
getInstanceCount(Resource resource,
EClassifier eClassifier)
|
static int |
getInstanceCount(ResourceSet resourceSet,
EClassifier eClassifier)
|
protected static int |
getLesserLowerBound(int lowerBound,
int otherLowerBound)
|
protected static String |
getMessageSubstitution(Map context,
Object object)
|
protected static Object[] |
getMessageSubstitutions(Map context,
Object object0)
|
protected static Object[] |
getMessageSubstitutions(Map context,
Object object0,
Object object1)
|
protected static Object[] |
getMessageSubstitutions(Map context,
Object object0,
Object object1,
Object object2)
|
protected static List |
getOwnedAttributes(Type type)
|
protected static List |
getOwnedOperations(Type type)
|
static String |
getQualifiedText(EObject eObject)
|
static String |
getQualifiedText(EObject eObject,
UML2Util.QualifiedTextProvider qualifiedTextProvider)
|
protected static Collection |
getRootContainers(Collection eObjects)
|
protected static Object |
getTaggedValue(Element element,
String qualifiedStereotypeName,
String propertyName)
|
protected static Property |
getTaggedValueDefinition(Stereotype stereotype,
String propertyName)
|
protected static String |
getValidIdentifier(String name)
Obtains a valid (Java) identifier based on the specified name. |
static boolean |
isEmpty(String string)
|
static Package |
load(ResourceSet resourceSet,
URI uri)
|
static void |
merge(Package package_,
Map options)
|
static void |
merge(Package package_,
Map options,
DiagnosticChain diagnostics,
Map context)
|
protected static boolean |
safeEquals(Object thisObject,
Object thatObject)
|
protected static void |
setTaggedValue(Element element,
Stereotype stereotype,
String propertyName,
Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
protected static boolean DEBUG
EMPTY_STRING
public static final String EMPTY_STRING
- The empty string.
- See Also:
- Constant Field Values
LINE_SEPARATOR
protected static final String LINE_SEPARATOR
OPTION__DISCARD
public static final String OPTION__DISCARD
- See Also:
- Constant Field Values
OPTION__IGNORE
public static final String OPTION__IGNORE
- See Also:
- Constant Field Values
OPTION__PROCESS
public static final String OPTION__PROCESS
- See Also:
- Constant Field Values
OPTION__REPORT
public static final String OPTION__REPORT
- See Also:
- Constant Field Values
ANNOTATION_SOURCE__DUPLICATES
protected static final String ANNOTATION_SOURCE__DUPLICATES
- See Also:
- Constant Field Values
ANNOTATION_SOURCE__REDEFINES
protected static final String ANNOTATION_SOURCE__REDEFINES
- See Also:
- Constant Field Values
ANNOTATION_SOURCE__SUBSETS
protected static final String ANNOTATION_SOURCE__SUBSETS
- See Also:
- Constant Field Values
ANNOTATION_SOURCE__UNION
protected static final String ANNOTATION_SOURCE__UNION
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__ATTRIBUTE
protected static final String ENUMERATION_LITERAL_NAME__ATTRIBUTE
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__ATTRIBUTE_WILDCARD
protected static final String ENUMERATION_LITERAL_NAME__ATTRIBUTE_WILDCARD
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__ELEMENT
protected static final String ENUMERATION_LITERAL_NAME__ELEMENT
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__ELEMENT_ONLY
protected static final String ENUMERATION_LITERAL_NAME__ELEMENT_ONLY
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__ELEMENT_WILDCARD
protected static final String ENUMERATION_LITERAL_NAME__ELEMENT_WILDCARD
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__EMPTY
protected static final String ENUMERATION_LITERAL_NAME__EMPTY
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__GROUP
protected static final String ENUMERATION_LITERAL_NAME__GROUP
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__MIXED
protected static final String ENUMERATION_LITERAL_NAME__MIXED
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__NONE
protected static final String ENUMERATION_LITERAL_NAME__NONE
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__SIMPLE
protected static final String ENUMERATION_LITERAL_NAME__SIMPLE
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__READ_ONLY
protected static final String ENUMERATION_LITERAL_NAME__READ_ONLY
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__READ_ONLY_UNSETTABLE
protected static final String ENUMERATION_LITERAL_NAME__READ_ONLY_UNSETTABLE
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__READ_WRITE
protected static final String ENUMERATION_LITERAL_NAME__READ_WRITE
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__READ_WRITE_UNSETTABLE
protected static final String ENUMERATION_LITERAL_NAME__READ_WRITE_UNSETTABLE
- See Also:
- Constant Field Values
ENUMERATION_LITERAL_NAME__UNSPECIFIED
protected static final String ENUMERATION_LITERAL_NAME__UNSPECIFIED
- See Also:
- Constant Field Values
ENUMERATION_NAME__CONTENT_KIND
protected static final String ENUMERATION_NAME__CONTENT_KIND
- See Also:
- Constant Field Values
ENUMERATION_NAME__FEATURE_KIND
protected static final String ENUMERATION_NAME__FEATURE_KIND
- See Also:
- Constant Field Values
ENUMERATION_NAME__VISIBILITY_KIND
protected static final String ENUMERATION_NAME__VISIBILITY_KIND
- See Also:
- Constant Field Values
PROPERTY_NAME__ATTRIBUTE_NAME
protected static final String PROPERTY_NAME__ATTRIBUTE_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__BASE_PACKAGE
public static final String PROPERTY_NAME__BASE_PACKAGE
- See Also:
- Constant Field Values
PROPERTY_NAME__CLASS_NAME
protected static final String PROPERTY_NAME__CLASS_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__DATA_TYPE_NAME
protected static final String PROPERTY_NAME__DATA_TYPE_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__ENUM_NAME
protected static final String PROPERTY_NAME__ENUM_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__ENUM_LITERAL_NAME
protected static final String PROPERTY_NAME__ENUM_LITERAL_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__INSTANCE_CLASS_NAME
protected static final String PROPERTY_NAME__INSTANCE_CLASS_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__IS_ID
protected static final String PROPERTY_NAME__IS_ID
- See Also:
- Constant Field Values
PROPERTY_NAME__IS_RESOLVE_PROXIES
protected static final String PROPERTY_NAME__IS_RESOLVE_PROXIES
- See Also:
- Constant Field Values
PROPERTY_NAME__IS_TRANSIENT
protected static final String PROPERTY_NAME__IS_TRANSIENT
- See Also:
- Constant Field Values
PROPERTY_NAME__IS_UNSETTABLE
protected static final String PROPERTY_NAME__IS_UNSETTABLE
- See Also:
- Constant Field Values
PROPERTY_NAME__IS_VOLATILE
protected static final String PROPERTY_NAME__IS_VOLATILE
- See Also:
- Constant Field Values
PROPERTY_NAME__NS_PREFIX
protected static final String PROPERTY_NAME__NS_PREFIX
- See Also:
- Constant Field Values
PROPERTY_NAME__NS_URI
protected static final String PROPERTY_NAME__NS_URI
- See Also:
- Constant Field Values
PROPERTY_NAME__OPERATION_NAME
protected static final String PROPERTY_NAME__OPERATION_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__PACKAGE_NAME
protected static final String PROPERTY_NAME__PACKAGE_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__PARAMETER_NAME
protected static final String PROPERTY_NAME__PARAMETER_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__PREFIX
public static final String PROPERTY_NAME__PREFIX
- See Also:
- Constant Field Values
PROPERTY_NAME__REFERENCE_NAME
protected static final String PROPERTY_NAME__REFERENCE_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__VISIBILITY
protected static final String PROPERTY_NAME__VISIBILITY
- See Also:
- Constant Field Values
PROPERTY_NAME__XML_CONTENT_KIND
protected static final String PROPERTY_NAME__XML_CONTENT_KIND
- See Also:
- Constant Field Values
PROPERTY_NAME__XML_FEATURE_KIND
protected static final String PROPERTY_NAME__XML_FEATURE_KIND
- See Also:
- Constant Field Values
PROPERTY_NAME__XML_NAME
protected static final String PROPERTY_NAME__XML_NAME
- See Also:
- Constant Field Values
PROPERTY_NAME__XML_NAMESPACE
protected static final String PROPERTY_NAME__XML_NAMESPACE
- See Also:
- Constant Field Values
STEREOTYPE_NAME__E_ATTRIBUTE
protected static final String STEREOTYPE_NAME__E_ATTRIBUTE
- See Also:
- Constant Field Values
STEREOTYPE_NAME__E_CLASS
protected static final String STEREOTYPE_NAME__E_CLASS
- See Also:
- Constant Field Values
STEREOTYPE_NAME__E_DATA_TYPE
protected static final String STEREOTYPE_NAME__E_DATA_TYPE
- See Also:
- Constant Field Values
STEREOTYPE_NAME__E_ENUM
protected static final String STEREOTYPE_NAME__E_ENUM
- See Also:
- Constant Field Values
STEREOTYPE_NAME__E_ENUM_LITERAL
protected static final String STEREOTYPE_NAME__E_ENUM_LITERAL
- See Also:
- Constant Field Values
STEREOTYPE_NAME__E_OPERATION
protected static final String STEREOTYPE_NAME__E_OPERATION
- See Also:
- Constant Field Values
STEREOTYPE_NAME__E_PACKAGE
public static final String STEREOTYPE_NAME__E_PACKAGE
- See Also:
- Constant Field Values
STEREOTYPE_NAME__E_PARAMETER
protected static final String STEREOTYPE_NAME__E_PARAMETER
- See Also:
- Constant Field Values
STEREOTYPE_NAME__E_REFERENCE
protected static final String STEREOTYPE_NAME__E_REFERENCE
- See Also:
- Constant Field Values
UML2Util
protected UML2Util()
safeEquals
protected static boolean safeEquals(Object thisObject,
Object thatObject)
isEmpty
public static boolean isEmpty(String string)
findEObject
public static EObject findEObject(Collection eObjects,
UML2Util.EObjectMatcher filter)
getCommonEType
protected static EClassifier getCommonEType(EClassifier eType,
EClassifier otherEType)
getLesserLowerBound
protected static int getLesserLowerBound(int lowerBound,
int otherLowerBound)
getGreaterUpperBound
protected static int getGreaterUpperBound(int upperBound,
int otherUpperBound)
getTaggedValueDefinition
protected static Property getTaggedValueDefinition(Stereotype stereotype,
String propertyName)
getTaggedValue
protected static Object getTaggedValue(Element element,
String qualifiedStereotypeName,
String propertyName)
setTaggedValue
protected static void setTaggedValue(Element element,
Stereotype stereotype,
String propertyName,
Object value)
getValidIdentifier
protected static String getValidIdentifier(String name)
- Obtains a valid (Java) identifier based on the specified name.
- Parameters:
name
- The name from which to obtain a valid identifier.
- Returns:
- A valid (Java) identifier or the empty string.
appendValidIdentifier
protected static StringBuffer appendValidIdentifier(StringBuffer validIdentifier,
String name)
- Appends a valid (Java) identifier based on the specified name to the
specified buffer.
- Parameters:
validIdentifier
- The buffer to which to append the valid identifier.name
- The name from which to obtain the valid identifier.
- Returns:
- The buffer.
getQualifiedText
public static String getQualifiedText(EObject eObject)
getQualifiedText
public static String getQualifiedText(EObject eObject,
UML2Util.QualifiedTextProvider qualifiedTextProvider)
appendQualifiedText
protected static StringBuffer appendQualifiedText(StringBuffer qualifiedText,
EObject eObject,
UML2Util.QualifiedTextProvider qualifiedTextProvider)
appendQualifiedTextSegment
protected static StringBuffer appendQualifiedTextSegment(StringBuffer qualifiedText,
EObject eObject,
UML2Util.QualifiedTextProvider qualifiedTextProvider)
findNamedElements
public static Collection findNamedElements(ResourceSet resourceSet,
String qualifiedName)
findNamedElements
public static Collection findNamedElements(ResourceSet resourceSet,
String qualifiedName,
boolean ignoreCase)
findNamedElements
public static Collection findNamedElements(ResourceSet resourceSet,
String qualifiedName,
boolean ignoreCase,
EClass eClass)
findNamedElements
public static Collection findNamedElements(Resource resource,
String qualifiedName)
findNamedElements
public static Collection findNamedElements(Resource resource,
String qualifiedName,
boolean ignoreCase)
findNamedElements
public static Collection findNamedElements(Resource resource,
String qualifiedName,
boolean ignoreCase,
EClass eClass)
findNamedElements
protected static Collection findNamedElements(Collection eObjects,
String qualifiedName,
boolean ignoreCase,
EClass eClass,
Collection namedElements)
getInstanceCount
public static int getInstanceCount(ResourceSet resourceSet,
EClassifier eClassifier)
getInstanceCount
public static int getInstanceCount(Resource resource,
EClassifier eClassifier)
getInstanceCount
public static int getInstanceCount(EObject eObject,
EClassifier eClassifier)
getInstanceCount
public static int getInstanceCount(Iterator iterator,
EClassifier eClassifier)
createEAnnotation
protected static EAnnotation createEAnnotation(EModelElement eModelElement,
String source)
getEAnnotation
protected static EAnnotation getEAnnotation(EModelElement eModelElement,
String source,
boolean createOnDemand)
addConstraint
protected static void addConstraint(EModelElement eModelElement,
String constraint)
addDocumentation
protected static void addDocumentation(EModelElement eModelElement,
String text)
getMessageSubstitution
protected static String getMessageSubstitution(Map context,
Object object)
getMessageSubstitutions
protected static Object[] getMessageSubstitutions(Map context,
Object object0)
getMessageSubstitutions
protected static Object[] getMessageSubstitutions(Map context,
Object object0,
Object object1)
getMessageSubstitutions
protected static Object[] getMessageSubstitutions(Map context,
Object object0,
Object object1,
Object object2)
getRootContainers
protected static Collection getRootContainers(Collection eObjects)
getAllContents
protected static TreeIterator getAllContents(EObject eObject,
boolean includeRoot,
boolean defensiveCopy)
load
public static Package load(ResourceSet resourceSet,
URI uri)
getOwnedAttributes
protected static List getOwnedAttributes(Type type)
getOwnedOperations
protected static List getOwnedOperations(Type type)
convertFromEcore
public static Collection convertFromEcore(EPackage ePackage,
Map options)
convertFromEcore
public static Collection convertFromEcore(EPackage ePackage,
Map options,
DiagnosticChain diagnostics,
Map context)
convertToEcore
public static Collection convertToEcore(Package package_,
Map options)
convertToEcore
public static Collection convertToEcore(Package package_,
Map options,
DiagnosticChain diagnostics,
Map context)
merge
public static void merge(Package package_,
Map options)
merge
public static void merge(Package package_,
Map options,
DiagnosticChain diagnostics,
Map context)