Source Code Cross Referenced for EclipseSignaturesHelper.java in  » Testing » KeY » de » uka » ilkd » key » casetool » eclipse » 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 » Testing » KeY » de.uka.ilkd.key.casetool.eclipse 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package de.uka.ilkd.key.casetool.eclipse;
002:
003:        /*
004:         * This file is part of KeY - Integrated Deductive Software Design
005:         * Copyright (C) 2001-2005 Universitaet Karlsruhe, Germany
006:         *                        Universitaet Koblenz-Landau, Germany
007:         *                        Chalmers University of Technology, Sweden
008:         *
009:         * The KeY system is protected by the GNU General Public License.
010:         */
011:
012:        import org.eclipse.jdt.core.IType;
013:        import org.eclipse.jdt.core.JavaModelException;
014:        import org.eclipse.jdt.core.Signature;
015:
016:        /**
017:         * @author Marius Hillenbrand
018:         *
019:         */
020:        public class EclipseSignaturesHelper {
021:
022:            /**
023:             * @param string
024:             * @return
025:             */
026:            public static String determineJavaType(String eclipseSignature,
027:                    IType surroundingType) {
028:                // TODO when upgrading to jdk1.5: add support for the various generic
029:                // type expressions
030:
031:                switch (eclipseSignature.charAt(0)) {
032:
033:                case Signature.C_ARRAY: // this parameter is an array
034:
035:                    int depth = Signature.getArrayCount(eclipseSignature);
036:
037:                    StringBuffer type = new StringBuffer(determineJavaType(
038:                            Signature.getElementType(eclipseSignature),
039:                            surroundingType));
040:                    // array type is <element type> ([])+, now create the []s
041:
042:                    for (int i = 0; i < depth; i++)
043:                        type.append('[');
044:                    type.append(']');
045:                    // this is probably much faster, than handling String-objects ?!
046:                    return type.toString();
047:
048:                    // primitive types:
049:                case Signature.C_BOOLEAN:
050:                    return "boolean";
051:
052:                case Signature.C_BYTE:
053:                    return "byte";
054:
055:                case Signature.C_CHAR:
056:                    return "char";
057:
058:                case Signature.C_DOUBLE:
059:                    return "double";
060:
061:                case Signature.C_FLOAT:
062:                    return "float";
063:
064:                case Signature.C_INT:
065:                    return "int";
066:
067:                case Signature.C_LONG:
068:                    return "long";
069:
070:                case Signature.C_SHORT:
071:                    return "short";
072:
073:                    // arbitrary types with fully-qualified name
074:                case Signature.C_RESOLVED:
075:                    return eclipseSignature.substring(1, eclipseSignature
076:                            .length() - 1);
077:                    // eclipse input is "Lpackage.Type;", so
078:                    // cut off the first and last character
079:
080:                    // arbitrary types with unresolved names
081:                case Signature.C_UNRESOLVED:
082:                    String unqualifiedTypeName = eclipseSignature.substring(1,
083:                            eclipseSignature.length() - 1);
084:                    try {
085:                        String[][] resolvedTypes = surroundingType
086:                                .resolveType(unqualifiedTypeName);
087:                        if (resolvedTypes != null && resolvedTypes.length > 0) {
088:                            return (resolvedTypes[0][0].equals("") ? ""
089:                                    : resolvedTypes[0][0] + ".")
090:                                    + resolvedTypes[0][1];
091:                        } else {
092:                            return null;
093:                        }
094:
095:                    } catch (JavaModelException e) {
096:                        // TODO Auto-generated catch block
097:                        e.printStackTrace();
098:                    }
099:
100:                }
101:                throw new RuntimeException("Eclipse Signature type "
102:                        + eclipseSignature + "not checked, add support !!");
103:            }
104:
105:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.