Source Code Cross Referenced for ModelFacadeLogicImpl.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 Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.andromda.metafacades.emf.uml2;
002:
003:        import java.util.Collection;
004:        import java.util.Collections;
005:        import java.util.Iterator;
006:
007:        import org.andromda.metafacades.uml.ActionStateFacade;
008:        import org.andromda.metafacades.uml.ActivityGraphFacade;
009:        import org.andromda.metafacades.uml.UseCaseFacade;
010:        import org.apache.commons.collections.CollectionUtils;
011:        import org.apache.commons.collections.Predicate;
012:        import org.eclipse.uml2.Actor;
013:        import org.eclipse.uml2.FinalState;
014:        import org.eclipse.uml2.State;
015:        import org.eclipse.uml2.StateMachine;
016:        import org.eclipse.uml2.UseCase;
017:
018:        /**
019:         * MetafacadeLogic implementation for org.andromda.metafacades.uml.ModelFacade.
020:         *
021:         * @see org.andromda.metafacades.uml.ModelFacade
022:         */
023:        public class ModelFacadeLogicImpl extends ModelFacadeLogic {
024:            public ModelFacadeLogicImpl(
025:                    final org.eclipse.uml2.util.UML2Resource metaObject,
026:                    final String context) {
027:                super (metaObject, context);
028:            }
029:
030:            /**
031:             * @see org.andromda.metafacades.uml.ModelFacade#findUseCaseWithTaggedValueOrHyperlink(java.lang.String,
032:             *      java.lang.String)
033:             */
034:            protected org.andromda.metafacades.uml.UseCaseFacade handleFindUseCaseWithTaggedValueOrHyperlink(
035:                    final java.lang.String tag, final java.lang.String value) {
036:                // TODO
037:                throw new UnsupportedOperationException();
038:            }
039:
040:            /**
041:             *
042:             * @see org.andromda.metafacades.uml.ModelFacade#findClassWithTaggedValueOrHyperlink(java.lang.String,
043:             *      java.lang.String)
044:             */
045:            protected org.andromda.metafacades.uml.ClassifierFacade handleFindClassWithTaggedValueOrHyperlink(
046:                    final java.lang.String tag, final java.lang.String value) {
047:                // TODO
048:                throw new UnsupportedOperationException();
049:            }
050:
051:            /**
052:             * @see org.andromda.metafacades.uml.ModelFacade#findActivityGraphByName(java.lang.String)
053:             */
054:            protected org.andromda.metafacades.uml.ActivityGraphFacade handleFindActivityGraphByName(
055:                    final java.lang.String name) {
056:                return this .findActivityGraphByNameAndStereotype(name, null);
057:            }
058:
059:            /**
060:             * @see org.andromda.metafacades.uml.ModelFacade#findActivityGraphByNameAndStereotype(java.lang.String,
061:             *      java.lang.String)
062:             */
063:            protected org.andromda.metafacades.uml.ActivityGraphFacade handleFindActivityGraphByNameAndStereotype(
064:                    final java.lang.String name,
065:                    final java.lang.String stereotypeName) {
066:                ActivityGraphFacade agfFound = null;
067:
068:                Collection agfCollection = UmlUtilities
069:                        .getAllMetaObjectsInstanceOf(StateMachine.class,
070:                                UmlUtilities.findModel(this .metaObject));
071:
072:                for (Iterator it = agfCollection.iterator(); it.hasNext()
073:                        && agfFound == null;) {
074:                    ActivityGraphFacade agf = (ActivityGraphFacade) this 
075:                            .shieldedElement(it.next());
076:                    if (agf.getName().equals(name)) {
077:                        if (stereotypeName == null
078:                                || agf.hasStereotype(stereotypeName)) {
079:                            agfFound = agf;
080:                        }
081:                    }
082:                }
083:                return agfFound;
084:            }
085:
086:            /**
087:             * @see org.andromda.metafacades.uml.ModelFacade#findUseCaseByName(java.lang.String)
088:             */
089:            protected org.andromda.metafacades.uml.UseCaseFacade handleFindUseCaseByName(
090:                    final java.lang.String name) {
091:                return this .findUseCaseWithNameAndStereotype(name, null);
092:            }
093:
094:            /**
095:             * @see org.andromda.metafacades.uml.ModelFacade#findUseCaseWithNameAndStereotype(java.lang.String,
096:             *      java.lang.String)
097:             */
098:            protected org.andromda.metafacades.uml.UseCaseFacade handleFindUseCaseWithNameAndStereotype(
099:                    final java.lang.String name,
100:                    final java.lang.String stereotypeName) {
101:                UseCaseFacade ucfFound = null;
102:                Collection ucCollections = this .getAllUseCases();
103:                for (Iterator it = ucCollections.iterator(); it.hasNext()
104:                        && ucfFound == null;) {
105:                    UseCaseFacade ucf = (UseCaseFacade) it.next();
106:                    if (ucf.getName().equals(name)) {
107:                        if (stereotypeName == null
108:                                || ucf.hasStereotype(stereotypeName)) {
109:                            ucfFound = ucf;
110:                        }
111:                    }
112:                }
113:                return ucfFound;
114:            }
115:
116:            /**
117:             * @see org.andromda.metafacades.uml.ModelFacade#findFinalStatesWithNameOrHyperlink(org.andromda.metafacades.uml.UseCaseFacade)
118:             */
119:            protected java.util.Collection handleFindFinalStatesWithNameOrHyperlink(
120:                    final org.andromda.metafacades.uml.UseCaseFacade useCase) {
121:                Collection fsCollection = UmlUtilities
122:                        .getAllMetaObjectsInstanceOf(FinalState.class,
123:                                UmlUtilities.findModel(this .metaObject));
124:                CollectionUtils.filter(fsCollection, new Predicate() {
125:                    public boolean evaluate(final Object candidate) {
126:                        FinalState fs = (FinalState) candidate;
127:                        return fs.getName().equals(useCase.getName());
128:                    }
129:                });
130:
131:                return fsCollection;
132:            }
133:
134:            /**
135:             * @see org.andromda.metafacades.uml.ModelFacade#getAllActionStatesWithStereotype(org.andromda.metafacades.uml.ActivityGraphFacade,
136:             *      java.lang.String)
137:             */
138:            protected java.util.Collection handleGetAllActionStatesWithStereotype(
139:                    final org.andromda.metafacades.uml.ActivityGraphFacade activityGraph,
140:                    final java.lang.String stereotypeName) {
141:                Collection asCollection = this .getAllActionStates();
142:                CollectionUtils.filter(asCollection, new Predicate() {
143:                    public boolean evaluate(final Object candidate) {
144:                        ActionStateFacade asf = (ActionStateFacade) candidate;
145:                        return asf.hasStereotype(stereotypeName)
146:                                && asf.getPartition().getActivityGraph()
147:                                        .equals(activityGraph);
148:                    }
149:                });
150:
151:                return asCollection;
152:            }
153:
154:            /**
155:             * @see org.andromda.metafacades.uml.ModelFacade#getRootPackage()
156:             */
157:            protected java.lang.Object handleGetRootPackage() {
158:                Object model = UmlUtilities.findModel(this .metaObject);
159:                if (this .logger.isDebugEnabled()) {
160:                    this .logger.debug("Root package " + model);
161:                }
162:                return model;
163:            }
164:
165:            /**
166:             * @see org.andromda.metafacades.uml.ModelFacade#getAllActors()
167:             */
168:            protected java.util.Collection handleGetAllActors() {
169:                return UmlUtilities.getAllMetaObjectsInstanceOf(Actor.class,
170:                        UmlUtilities.findModel(this .metaObject));
171:            }
172:
173:            /**
174:             * @see org.andromda.metafacades.uml.ModelFacade#getAllUseCases()
175:             */
176:            protected java.util.Collection handleGetAllUseCases() {
177:                return UmlUtilities.getAllMetaObjectsInstanceOf(UseCase.class,
178:                        UmlUtilities.findModel(this .metaObject));
179:            }
180:
181:            /**
182:             * @see org.andromda.metafacades.uml.ModelFacade#getAllActionStates()
183:             */
184:            protected java.util.Collection handleGetAllActionStates() {
185:                // cf documentation, action states are mapped to uml2 normal state
186:                Collection allActionStates = UmlUtilities
187:                        .getAllMetaObjectsInstanceOf(State.class, UmlUtilities
188:                                .findModel(this .metaObject));
189:                CollectionUtils.filter(allActionStates, new Predicate() {
190:                    public boolean evaluate(final Object candidate) {
191:                        return (!(candidate instanceof  FinalState));
192:                    }
193:                });
194:                return allActionStates;
195:            }
196:
197:            /**
198:             * @see org.andromda.metafacades.uml.ModelFacade#getAllObjectFlowStates()
199:             */
200:            protected java.util.Collection handleGetAllObjectFlowStates() {
201:                // TODO: Not implemented
202:                return Collections.EMPTY_LIST;
203:            }
204:
205:            /**
206:             * @see org.andromda.metafacades.uml.ModelFacade#getAllClasses()
207:             */
208:            protected java.util.Collection handleGetAllClasses() {
209:                return UmlUtilities.getAllMetaObjectsInstanceOf(
210:                        org.eclipse.uml2.Class.class, UmlUtilities
211:                                .findModel(this.metaObject));
212:            }
213:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.