Java Doc for UmlUtilities.java in  » UML » AndroMDA-3.2 » org » andromda » metafacades » emf » uml2 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » UML » AndroMDA 3.2 » org.andromda.metafacades.emf.uml2 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.andromda.metafacades.emf.uml2.UmlUtilities

UmlUtilities
public class UmlUtilities (Code)
Contains utilities for the Eclipse/UML2 metafacades.
author:
   Steve Jerman
author:
   Chad Brandon
author:
   Wouter Zoons


Field Summary
final protected static  TransformerELEMENT_TRANSFORMER
    


Method Summary
public static  StringcleanText(String text)
     Gets rid of all excess whitespace.
Parameters:
  text - the text from which to remove the white space.
public static  booleancontainsStereotype(Element element, String stereotypeName)
     Indicates whether or not the given element contains a stereotype with the given stereotypeName.
public static  booleandoesTagValueNameMatch(String requestedName, String tagValueName)
     There is an issue with EMF / XMI about tag value name (there should not be any @ or .
public static  StereotypefindApplicableStereotype(Element element, String name)
     Attempts to find the applicable stereotype with the given name on the given element.
public static  StereotypefindAppliedStereotype(Element element, String name)
     Attempts to find the applied stereotype with the given name on the given element.
static  ObjectfindByFullyQualifiedName(ResourceSet rs, String fullyQualifiedName, String separator, boolean modelName)
     Finds a given model element in the model having the specified fullyQualifiedName.
static  ObjectfindByName(ResourceSet rs, String name)
     Finds and returns the first model element having the given name in the modelPackage, returns null if not found.
Parameters:
  rs - the resource set to search in
Parameters:
  name - the name to find.
static  ObjectfindByPredicate(ResourceSet resourceSet, Predicate pred)
     Finds and returns the first model element having the given name in the modelPackage, returns null if not found.
public static  ModelfindModel(UML2Resource resource)
    
public static  ListgetAllMetaObjectsInstanceOf(java.lang.Class metaClass, Model model)
     List all meta objects instances of a given meta class It's a way to achieve refAllOfType method in a JMI implementation.
public static  ListgetAssociationEnds(Classifier classifier, boolean follow)
     Gets a collection containing all of the associationEnds for this class/interface.
public static  ListgetAttributes(Classifier umlClassifier, boolean follow)
     Gets a collection containing all of the attributes for this class/interface.
public static  StringgetComment(Element element)
     Get the comments for a UML Element.
static  AssociationEndgetOppositeAssociationEnd(Property associationEnd)
     Gets the opposite end of the given associationEnd if the property is indeed an association end, otherwise returns null.
Parameters:
  associationEnd - the association end from which to retrieve the opposite end.
static  StringgetPackageName(NamedElement metaObject, String separator, boolean modelName)
     Constructs the package name for the given metaObject, seperating the package name by the given separator.
Parameters:
  metaObject - the Model Element
Parameters:
  separator - the PSM namespace separator, ignored if modelName is true
Parameters:
  modelName - true/false on whether or not to get the model package nameinstead of the PSM package name.
static  StringgetPackageName(Element metaObject, String separator, boolean modelName)
     Returns the package name of the closest ancestor that is an instance of NamedElement.
static  StringgetSerialVersionUID(ClassifierFacade classifier)
     Retrieves the serial version UID by reading the tagged value UMLProfile.TAGGEDVALUE_SERIALVERSION_UID of the classifier.
Parameters:
  classifier - the classifier to be inspected.
public static  ListgetSpecializations(Classifier classifier)
     Retrieves all specializations of the given classifier instance.
Parameters:
  classifier - the classifier from which to retrieve the specializations.
public static  ListgetStereotypeNames(Element element)
     Retrieves the names of the stereotypes for the given element
Parameters:
  element - the element for which to retrieve the stereotypes.
static  StringgetTagValueAsString(Object tagValue)
     The toString() method isn't suitable to transform the values of tagValue as String.
public static  CollectiongetTaggedValue(NamedElement element)
     Retrieves the TagDefinitions for the given element.
Parameters:
  element - the element from which to retrieve the tagged values.
public static  StringgetType(TypedElement element)
     Retrieves the name of the type for the given element.
Parameters:
  element - the element for which to retrieve the type.
public static  booleanisAssociationEndAttachedToType(Classifier classifier, Property property, boolean follow)
     Returns true if the given association end's type is an ancestor of the classifier, or just the argument classifier if follow is false.
public static  booleanisSameSignature(Operation first, Operation second)
     Returns true if and only if the given operation would have an identical signature.
static  intparseMultiplicity(ValueSpecification multValue)
     Multiplicity can be expressed as Value.

Field Detail
ELEMENT_TRANSFORMER
final protected static Transformer ELEMENT_TRANSFORMER(Code)
A transformer which transforms:
  • each property in an attribute or an association end
  • each slot in an attribute link or a link end
  • each instance specification in an object instance or a link instance
This is needed because UML2 is an API in which there is no conceptual difference between fundamentally different elements (see list above); which makes it harder to map to metafacades geared towards UML 1.4





Method Detail
cleanText
public static String cleanText(String text)(Code)
Gets rid of all excess whitespace.
Parameters:
  text - the text from which to remove the white space. the cleaned text.



containsStereotype
public static boolean containsStereotype(Element element, String stereotypeName)(Code)
Indicates whether or not the given element contains a stereotype with the given stereotypeName.
Parameters:
  element - the element instance.
Parameters:
  stereotypeName - the name of the stereotype true/false



doesTagValueNameMatch
public static boolean doesTagValueNameMatch(String requestedName, String tagValueName)(Code)
There is an issue with EMF / XMI about tag value name (there should not be any @ or . inside) This method checks whether tagValueName can be seen as requestedName.
  • We compare them either: without name transformation removing initial '@' and replacing '.' by '_' (rsm / emf-uml2 profile) EMF normalization (for MD11.5 export)
    Parameters:
      requestedName -
    Parameters:
      tagValueName -



  • findApplicableStereotype
    public static Stereotype findApplicableStereotype(Element element, String name)(Code)
    Attempts to find the applicable stereotype with the given name on the given element. First tries to find it with the fully qualified name, and then tries it with just the name.
    Parameters:
      name - the name of the stereotype the found stereotype or null if not found.



    findAppliedStereotype
    public static Stereotype findAppliedStereotype(Element element, String name)(Code)
    Attempts to find the applied stereotype with the given name on the given element. First tries to find it with the fully qualified name, and then tries it with just the name.
    Parameters:
      name - the name of the stereotype the found stereotype or null if not found.



    findByFullyQualifiedName
    static Object findByFullyQualifiedName(ResourceSet rs, String fullyQualifiedName, String separator, boolean modelName)(Code)
    Finds a given model element in the model having the specified fullyQualifiedName. If the model element can NOT be found, null will be returned instead.
    Parameters:
      rs - the resource set to search in
    Parameters:
      fullyQualifiedName - the fully qualified name of the element to search for.
    Parameters:
      separator - the PSM separator used for qualifying the name (example ".").
    Parameters:
      modelName - a flag indicating whether or not a search shall be performedusing the fully qualified model name or fully qualified PSMname. the found model element



    findByName
    static Object findByName(ResourceSet rs, String name)(Code)
    Finds and returns the first model element having the given name in the modelPackage, returns null if not found.
    Parameters:
      rs - the resource set to search in
    Parameters:
      name - the name to find. the found model element.



    findByPredicate
    static Object findByPredicate(ResourceSet resourceSet, Predicate pred)(Code)
    Finds and returns the first model element having the given name in the modelPackage, returns null if not found. the found model element.



    findModel
    public static Model findModel(UML2Resource resource)(Code)
    Find the Model of a ressource (UML2 Model)



    getAllMetaObjectsInstanceOf
    public static List getAllMetaObjectsInstanceOf(java.lang.Class metaClass, Model model)(Code)
    List all meta objects instances of a given meta class It's a way to achieve refAllOfType method in a JMI implementation. Please take care of the fact that properties are not transformed here.
    Parameters:
      metaClass - The meta class we're looking for its instances
    Parameters:
      model - The model where we're searching a list of objects owned by model, instance of metaClass



    getAssociationEnds
    public static List getAssociationEnds(Classifier classifier, boolean follow)(Code)
    Gets a collection containing all of the associationEnds for this class/interface. Superclass properties will be included if follow is true. Overridden properties will be omitted.

    cejeanne: Changed the way association end are found.
    Parameters:
      classifier - the UML class instance from which to retrieve all properties
    Parameters:
      follow - whether or not the inheritance hierarchy should be followed all retrieved attributes.




    getAttributes
    public static List getAttributes(Classifier umlClassifier, boolean follow)(Code)
    Gets a collection containing all of the attributes for this class/interface. Superclass properties will included if follow is true. Overridden properties will be omitted.
    Parameters:
      umlClassifier - the UML class instance from which to retrieve all properties
    Parameters:
      follow - whether or not the inheritance hierarchy should be followed all retrieved attributes.



    getComment
    public static String getComment(Element element)(Code)
    Get the comments for a UML Element. This will be a string with each comment separated by a 2 newlines.
    Parameters:
      element - concatenated string



    getOppositeAssociationEnd
    static AssociationEnd getOppositeAssociationEnd(Property associationEnd)(Code)
    Gets the opposite end of the given associationEnd if the property is indeed an association end, otherwise returns null.
    Parameters:
      associationEnd - the association end from which to retrieve the opposite end. the opposite association end or null.



    getPackageName
    static String getPackageName(NamedElement metaObject, String separator, boolean modelName)(Code)
    Constructs the package name for the given metaObject, seperating the package name by the given separator.
    Parameters:
      metaObject - the Model Element
    Parameters:
      separator - the PSM namespace separator, ignored if modelName is true
    Parameters:
      modelName - true/false on whether or not to get the model package nameinstead of the PSM package name. the package name.



    getPackageName
    static String getPackageName(Element metaObject, String separator, boolean modelName)(Code)
    Returns the package name of the closest ancestor that is an instance of NamedElement. If no such ancestor exists the empty String is returned.

    If the argument would be an instance of NamedElement then this method returns that object's package name.
    See Also:   UmlUtilities.getPackageName(org.eclipse.uml2.NamedElement,String,boolean)




    getSerialVersionUID
    static String getSerialVersionUID(ClassifierFacade classifier)(Code)
    Retrieves the serial version UID by reading the tagged value UMLProfile.TAGGEDVALUE_SERIALVERSION_UID of the classifier.
    Parameters:
      classifier - the classifier to be inspected. the serial version UID of the classifier. Returnsnull if the tagged value cannot be found.



    getSpecializations
    public static List getSpecializations(Classifier classifier)(Code)
    Retrieves all specializations of the given classifier instance.
    Parameters:
      classifier - the classifier from which to retrieve the specializations. all specializations.



    getStereotypeNames
    public static List getStereotypeNames(Element element)(Code)
    Retrieves the names of the stereotypes for the given element
    Parameters:
      element - the element for which to retrieve the stereotypes. all stereotype names



    getTagValueAsString
    static String getTagValueAsString(Object tagValue)(Code)
    The toString() method isn't suitable to transform the values of tagValue as String.
    Parameters:
      tagValue - the tag value as a string.



    getTaggedValue
    public static Collection getTaggedValue(NamedElement element)(Code)
    Retrieves the TagDefinitions for the given element.
    Parameters:
      element - the element from which to retrieve the tagged values. the collection of TagDefinition instances.



    getType
    public static String getType(TypedElement element)(Code)
    Retrieves the name of the type for the given element.
    Parameters:
      element - the element for which to retrieve the type. the type name.



    isAssociationEndAttachedToType
    public static boolean isAssociationEndAttachedToType(Classifier classifier, Property property, boolean follow)(Code)
    Returns true if the given association end's type is an ancestor of the classifier, or just the argument classifier if follow is false.
    Parameters:
      property - this method returns false if this argument is not an association end



    isSameSignature
    public static boolean isSameSignature(Operation first, Operation second)(Code)
    Returns true if and only if the given operation would have an identical signature. This means:
    • the same name
    • the same number of parameters
    • matching parameter types (in that very same order)



    parseMultiplicity
    static int parseMultiplicity(ValueSpecification multValue)(Code)
    Multiplicity can be expressed as Value. String, integer... This method parse it. MD11.5 uses string, and RSM integers.
    Parameters:
      multValue - a ValueSpecification, which need to be parsed the parsed intrger



    Methods inherited from java.lang.Object
    native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
    public boolean equals(Object obj)(Code)(Java Doc)
    protected void finalize() throws Throwable(Code)(Java Doc)
    final native public Class getClass()(Code)(Java Doc)
    native public int hashCode()(Code)(Java Doc)
    final native public void notify()(Code)(Java Doc)
    final native public void notifyAll()(Code)(Java Doc)
    public String toString()(Code)(Java Doc)
    final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
    final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
    final public void wait() throws InterruptedException(Code)(Java Doc)

    www.java2java.com | Contact Us
    Copyright 2009 - 12 Demo Source and Support. All rights reserved.
    All other trademarks are property of their respective owners.