Source Code Cross Referenced for ParameterFacadeLogicImpl.java in  » UML » AndroMDA-3.2 » org » andromda » metafacades » uml14 » 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.uml14 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.andromda.metafacades.uml14;
002:
003:        import java.util.Collection;
004:        import java.util.Iterator;
005:
006:        import org.andromda.metafacades.uml.NameMasker;
007:        import org.andromda.metafacades.uml.UMLMetafacadeProperties;
008:        import org.andromda.metafacades.uml.UMLMetafacadeUtils;
009:        import org.andromda.metafacades.uml.UMLProfile;
010:        import org.andromda.utils.StringUtilsHelper;
011:        import org.apache.commons.lang.StringUtils;
012:        import org.omg.uml.behavioralelements.statemachines.Event;
013:        import org.omg.uml.foundation.core.Operation;
014:        import org.omg.uml.foundation.datatypes.Expression;
015:        import org.omg.uml.foundation.datatypes.ParameterDirectionKindEnum;
016:
017:        /**
018:         * Metaclass facade implementation.
019:         */
020:        public class ParameterFacadeLogicImpl extends ParameterFacadeLogic {
021:            public ParameterFacadeLogicImpl(
022:                    org.omg.uml.foundation.core.Parameter metaObject,
023:                    String context) {
024:                super (metaObject, context);
025:            }
026:
027:            /**
028:             * Overridden to provide name masking.
029:             *
030:             * @see org.andromda.metafacades.uml.ModelElementFacade#getName()
031:             */
032:            protected String handleGetName() {
033:                final String nameMask = String
034:                        .valueOf(this 
035:                                .getConfiguredProperty(UMLMetafacadeProperties.PARAMETER_NAME_MASK));
036:                return NameMasker.mask(super .handleGetName(), nameMask);
037:            }
038:
039:            /**
040:             * @see org.andromda.metafacades.uml.ParameterFacade#getGetterName()
041:             */
042:            protected java.lang.String handleGetGetterName() {
043:                return UMLMetafacadeUtils.getGetterPrefix(this .getType())
044:                        + StringUtilsHelper.capitalize(this .getName());
045:            }
046:
047:            /**
048:             * @see org.andromda.metafacades.uml.ParameterFacade#getSetterName()
049:             */
050:            protected java.lang.String handleGetSetterName() {
051:                return "set" + StringUtilsHelper.capitalize(this .getName());
052:            }
053:
054:            /**
055:             * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
056:             */
057:            public Object getValidationOwner() {
058:                Object owner = this .getOperation();
059:
060:                if (owner == null) {
061:                    owner = this .getEvent();
062:                }
063:
064:                return owner;
065:            }
066:
067:            /**
068:             * @see org.andromda.metafacades.uml.ParameterFacade#getDefaultValue()
069:             */
070:            public String handleGetDefaultValue() {
071:                final Expression expression = this .metaObject.getDefaultValue();
072:                return expression == null ? "" : expression.getBody();
073:            }
074:
075:            /**
076:             * @see org.andromda.metafacades.uml.ParameterFacade#isDefaultValuePresent()
077:             */
078:            public boolean handleIsDefaultValuePresent() {
079:                return StringUtils.isNotBlank(this .getDefaultValue());
080:            }
081:
082:            /**
083:             * @see org.andromda.metafacades.uml.ParameterFacade#getType()
084:             */
085:            protected Object handleGetType() {
086:                return this .metaObject.getType();
087:            }
088:
089:            /**
090:             * @see org.andromda.metafacades.uml.ParameterFacade#isReturn()
091:             */
092:            public boolean handleIsReturn() {
093:                return ParameterDirectionKindEnum.PDK_RETURN
094:                        .equals(this .metaObject.getKind());
095:            }
096:
097:            /**
098:             * @see org.andromda.metafacades.uml.ParameterFacade#isRequired()
099:             */
100:            protected boolean handleIsRequired() {
101:                return !this .hasStereotype(UMLProfile.STEREOTYPE_NULLABLE);
102:            }
103:
104:            /**
105:             * @see org.andromda.metafacades.uml.ParameterFacade#getOperation()
106:             */
107:            protected Object handleGetOperation() {
108:                Operation parameterOperation = null;
109:                final Collection allOperations = UML14MetafacadeUtils
110:                        .getModel().getCore().getOperation().refAllOfType();
111:                for (final Iterator iterator = allOperations.iterator(); iterator
112:                        .hasNext()
113:                        && parameterOperation == null;) {
114:                    final Operation operation = (Operation) iterator.next();
115:                    if (operation.getParameter().contains(this .metaObject)) {
116:                        parameterOperation = operation;
117:                    }
118:                }
119:                return parameterOperation;
120:            }
121:
122:            /**
123:             * @see org.andromda.metafacades.uml.ParameterFacade#getEvent()
124:             */
125:            protected Object handleGetEvent() {
126:                Event parameterEvent = null;
127:                final Collection allEvents = UML14MetafacadeUtils.getModel()
128:                        .getStateMachines().getEvent().refAllOfType();
129:                for (final Iterator iterator = allEvents.iterator(); iterator
130:                        .hasNext()
131:                        && parameterEvent == null;) {
132:                    final Event event = (Event) iterator.next();
133:                    if (event.getParameter().contains(this .metaObject)) {
134:                        parameterEvent = event;
135:                    }
136:                }
137:                return parameterEvent;
138:            }
139:
140:            /**
141:             * @see org.andromda.metafacades.uml.ParameterFacade#isReadable()
142:             */
143:            protected boolean handleIsReadable() {
144:                return this .isInParameter() || this .isInoutParameter();
145:            }
146:
147:            /**
148:             * @see org.andromda.metafacades.uml.ParameterFacade#isWritable()
149:             */
150:            protected boolean handleIsWritable() {
151:                return this .isOutParameter() || this .isInoutParameter();
152:            }
153:
154:            /**
155:             * @see org.andromda.metafacades.uml.ParameterFacade#isInParameter()
156:             */
157:            protected boolean handleIsInParameter() {
158:                return ParameterDirectionKindEnum.PDK_IN.equals(this .metaObject
159:                        .getKind());
160:            }
161:
162:            /**
163:             * @see org.andromda.metafacades.uml.ParameterFacade#isOutParameter()
164:             */
165:            protected boolean handleIsOutParameter() {
166:                return ParameterDirectionKindEnum.PDK_OUT
167:                        .equals(this .metaObject.getKind());
168:            }
169:
170:            /**
171:             * @see org.andromda.metafacades.uml.ParameterFacade#isInoutParameter()
172:             */
173:            protected boolean handleIsInoutParameter() {
174:                return ParameterDirectionKindEnum.PDK_INOUT
175:                        .equals(this .metaObject.getKind());
176:            }
177:
178:            /**
179:             * Get the UML upper multiplicity
180:             * Not implemented for UML1.4
181:             */
182:            protected int handleGetUpper() {
183:                throw new java.lang.UnsupportedOperationException(
184:                        "'upper' is not a UML1.4 feature");
185:            }
186:
187:            /**
188:             * Get the UML lower multiplicity
189:             * Not implemented for UML1.4
190:             */
191:            protected int handleGetLower() {
192:                throw new java.lang.UnsupportedOperationException(
193:                        "'lower' is not a UML1.4 feature");
194:            }
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.