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


001:        package org.andromda.cartridges.meta.metafacades;
002:
003:        import java.util.ArrayList;
004:        import java.util.Collection;
005:        import java.util.Iterator;
006:
007:        /**
008:         * @author <a href="http://www.mbohlen.de">Matthias Bohlen </a>
009:         * @author Chad Brandon
010:         * @since 10.12.2003
011:         */
012:        public class MethodData implements  Comparable {
013:            private String metafacadeName;
014:            private String visibility;
015:            private boolean isAbstract;
016:            private String name;
017:            private String returnTypeName;
018:            private String documentation;
019:            private final ArrayList arguments = new ArrayList();
020:            private final ArrayList exceptions = new ArrayList();
021:
022:            public MethodData(String metafacadeName, String visibility,
023:                    boolean isAbstract, String returnTypeName, String name,
024:                    String documentation) {
025:                this .metafacadeName = metafacadeName;
026:                this .visibility = visibility;
027:                this .isAbstract = isAbstract;
028:                this .name = name;
029:                this .returnTypeName = returnTypeName;
030:                this .documentation = documentation;
031:            }
032:
033:            public void addArgument(ArgumentData argument) {
034:                arguments.add(argument);
035:            }
036:
037:            /**
038:             * @return
039:             */
040:            public Collection getArguments() {
041:                return arguments;
042:            }
043:
044:            public void addException(String typeName) {
045:                exceptions.add(typeName);
046:            }
047:
048:            public Collection getExceptions() {
049:                return exceptions;
050:            }
051:
052:            /**
053:             * Gets the metafacade name.
054:             *
055:             * @return the name of the metafacade
056:             */
057:            public String getMetafacadeName() {
058:                return metafacadeName;
059:            }
060:
061:            /**
062:             * Gets the name of the method.
063:             *
064:             * @return the name.
065:             */
066:            public String getName() {
067:                return name;
068:            }
069:
070:            /**
071:             * Gets the name of the return type for this method.
072:             *
073:             * @return the return type name.
074:             */
075:            public String getReturnTypeName() {
076:                return returnTypeName;
077:            }
078:
079:            /**
080:             * Builds a string representing a declaration for this method.
081:             *
082:             * @param suppressAbstractDeclaration optionally suppress the "abstract" modifier
083:             * @return String the declaration
084:             */
085:            public String buildMethodDeclaration(
086:                    boolean suppressAbstractDeclaration) {
087:                String declaration = visibility
088:                        + " "
089:                        + ((isAbstract && !suppressAbstractDeclaration) ? "abstract "
090:                                : "")
091:                        + ((returnTypeName != null) ? (returnTypeName + " ")
092:                                : "") + name + "(";
093:
094:                for (final Iterator iterator = arguments.iterator(); iterator
095:                        .hasNext();) {
096:                    final ArgumentData argument = (ArgumentData) iterator
097:                            .next();
098:                    declaration += (argument.getFullyQualifiedTypeName() + " " + argument
099:                            .getName());
100:                    if (iterator.hasNext()) {
101:                        declaration += ", ";
102:                    }
103:                }
104:                declaration += ")";
105:
106:                if (exceptions.size() > 0) {
107:                    declaration += " throws ";
108:                    for (final Iterator iterator = exceptions.iterator(); iterator
109:                            .hasNext();) {
110:                        String exception = (String) iterator.next();
111:                        declaration += exception;
112:                        if (iterator.hasNext()) {
113:                            declaration += ", ";
114:                        }
115:                    }
116:                }
117:
118:                return declaration;
119:            }
120:
121:            /**
122:             * Builds a string representing a call to the method.
123:             *
124:             * @return String how a call would look like
125:             */
126:            public String buildMethodCall() {
127:                String call = getName() + "(";
128:
129:                for (final Iterator iterator = arguments.iterator(); iterator
130:                        .hasNext();) {
131:                    final ArgumentData argument = (ArgumentData) iterator
132:                            .next();
133:                    call += argument.getName();
134:                    if (iterator.hasNext()) {
135:                        call += ", ";
136:                    }
137:                }
138:                call += ")";
139:                return call;
140:            }
141:
142:            /**
143:             * Builds a signature which can be used as a key into a map. Consists of the return type, the name and the f.q.
144:             * types of the arguements.
145:             *
146:             * @return String the key that identifies this method
147:             */
148:            public String buildCharacteristicKey() {
149:                String key = ((returnTypeName != null) ? (returnTypeName + " ")
150:                        : "")
151:                        + name + "(";
152:
153:                for (final Iterator iterator = arguments.iterator(); iterator
154:                        .hasNext();) {
155:                    final ArgumentData argument = (ArgumentData) iterator
156:                            .next();
157:                    key += argument.getFullyQualifiedTypeName();
158:                    if (iterator.hasNext()) {
159:                        key += ",";
160:                    }
161:                }
162:                key += ")";
163:
164:                return key;
165:            }
166:
167:            /**
168:             * Indicates whether or not this method is abstract.
169:             *
170:             * @return true/false
171:             */
172:            public boolean isAbstract() {
173:                return isAbstract;
174:            }
175:
176:            /**
177:             * Gets the visibility of this method.
178:             *
179:             * @return the visibility.
180:             */
181:            public String getVisibility() {
182:                return visibility;
183:            }
184:
185:            /**
186:             * Gets the documentation for this method.
187:             *
188:             * @return the documentation.
189:             */
190:            public String getDocumentation() {
191:                return documentation;
192:            }
193:
194:            /**
195:             * Tells if this method returns something.
196:             *
197:             * @return boolean
198:             */
199:            public boolean isReturnTypePresent() {
200:                return returnTypeName != null && !returnTypeName.equals("void");
201:            }
202:
203:            /**
204:             * @see java.lang.Comparable#compareTo(java.lang.Object)
205:             */
206:            public int compareTo(final Object object) {
207:                MethodData other = (MethodData) object;
208:                int result = getMetafacadeName().compareTo(
209:                        other.getMetafacadeName());
210:                return (result != 0) ? result : getName().compareTo(
211:                        other.getName());
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.