Source Code Cross Referenced for JNIUtil.java in  » Byte-Code » PROSE » ch » ethz » inf » iks » jvmai » jvmdi » 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 » Byte Code » PROSE » ch.ethz.inf.iks.jvmai.jvmdi 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //
002:        //  This file is part of the prose package.
003:        //
004:        //  The contents of this file are subject to the Mozilla Public License
005:        //  Version 1.1 (the "License"); you may not use this file except in
006:        //  compliance with the License. You may obtain a copy of the License at
007:        //  http://www.mozilla.org/MPL/
008:        //
009:        //  Software distributed under the License is distributed on an "AS IS" basis,
010:        //  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
011:        //  for the specific language governing rights and limitations under the
012:        //  License.
013:        //
014:        //  The Original Code is prose.
015:        //
016:        //  The Initial Developer of the Original Code is Andrei Popovici. 
017:        //  The code has been extended by Angela Nicoara. 
018:        //  Portions created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
019:        //  All Rights Reserved.
020:        //
021:        //  Contributor(s):
022:        //  $Id: JNIUtil.java,v 1.1.1.1 2003/07/02 15:30:50 apopovic Exp $
023:        //  =====================================================================
024:        //
025:        //  (history at end)
026:        //
027:
028:        package ch.ethz.inf.iks.jvmai.jvmdi;
029:
030:        // used packages
031:        import java.lang.reflect.*;
032:
033:        /**
034:         * Class JNIUtil provides some useful methods for working with JNI.
035:         *
036:         * @version	$Revision: 1.1.1.1 $
037:         * @author	Andrei Popovici
038:         */
039:        public class JNIUtil {
040:
041:            /** Return the JNI signature of the method <code>m</code> */
042:            public static String jniSignature(Method m) {
043:                Class[] params = m.getParameterTypes();
044:                StringBuffer result = new StringBuffer();
045:                result.append("(");
046:                for (int i = 0; i < params.length; i++)
047:                    result.append(jniSignature(params[i]));
048:                result.append(")" + jniSignature(m.getReturnType()));
049:                return result.toString();
050:
051:            }
052:
053:            /** Return the JNI signature of the constructor <code>m</code> */
054:            public static String jniSignature(Constructor m) {
055:                Class[] params = m.getParameterTypes();
056:                StringBuffer result = new StringBuffer();
057:                result.append("(");
058:                for (int i = 0; i < params.length; i++)
059:                    result.append(jniSignature(params[i]));
060:                result.append(")V");
061:                return result.toString();
062:            }
063:
064:            /** Return the JNI signature of the class <code>c</code> */
065:            public static String jniSignature(Class c) {
066:                if (c.isPrimitive()) {
067:                    String result = null;
068:                    if ((c.toString()).equals("int"))
069:                        result = "I";
070:                    if ((c.toString()).equals("byte"))
071:                        result = "B";
072:                    if ((c.toString()).equals("short"))
073:                        result = "S";
074:                    if ((c.toString()).equals("long"))
075:                        result = "J";
076:                    if ((c.toString()).equals("double"))
077:                        result = "D";
078:                    if ((c.toString()).equals("float"))
079:                        result = "F";
080:                    if ((c.toString()).equals("char"))
081:                        result = "C";
082:                    if ((c.toString()).equals("boolean"))
083:                        result = "Z";
084:                    if ((c.toString()).equals("void"))
085:                        result = "V";
086:                    return result;
087:                } else if (c.isArray())
088:                    return "[" + jniSignature(c.getComponentType());
089:                else
090:                    return "L" + (c.getName()).replace('.', '/') + ";";
091:            }
092:
093:        }
094:
095:        //======================================================================
096:        //
097:        // $Log: JNIUtil.java,v $
098:        // Revision 1.1.1.1  2003/07/02 15:30:50  apopovic
099:        // Imported from ETH Zurich
100:        //
101:        // Revision 1.4  2003/03/04 11:26:41  popovici
102:        // Important refactorization step (march):
103:        // - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
104:        // - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
105:        //   structures
106:        //
107:        // Revision 1.3  2002/03/28 13:48:14  popovici
108:        // Mozilla-ified
109:        //
110:        // Revision 1.2  2002/02/14 16:02:25  popovici
111:        // Bug fixes, PROSEVM moved to boot
112:        //
113:        // Revision 1.1  2002/02/06 11:53:52  popovici
114:        // Refactoring from prose classical to jvmai
115:        //
116:        // Revision 1.1  2001/11/27 12:44:41  popovici
117:        // Initial Revision
118:        //
119:        // Revision 1.1.2.6  2001/11/21 11:56:30  popovici
120:        //
121:        // -The sun.tools.agent and ch.ethz.inf.util.JVMDIUtil functionality
122:        // replaced with the iks.jvmdi package. References to this old
123:        // functionality replaced throughout the code.
124:        // -Partial reimplementation of the ch.ethz.inf.iks.runes classes,
125:        // part of their functionality moved to the ch.ethz.inf.runes.reflect
126:        // abstract classes. New classes and functionality added to the
127:        // ch.ethz.inf.runes.reflect package, partially to reflect the
128:        // more stable features taken from the iks.runes packages, partially
129:        // to reflect the structure of the VM (constant pool, etc). Functionality in
130:        // ch.ethz.inf.runes.crosscut and the junit classes adapted to use the
131:        // new form of the ch.ethz.inf.runes.reflect package
132:        //
133:        // Revision 1.1.2.5  2001/02/21 13:23:30  popovici
134:        // methods 'executiveFieldSignature', 'executiveClassSignature', and 'executiveMethodSignature' added. They return non-fully qualified names
135:        // of signatures. Their place might not be in this class. Where else?!
136:        //
137:        // Revision 1.1.2.4  2001/01/18 14:24:37  popovici
138:        // SignatureTokenizer changed:constructor now accepts either bare signatures or singatures including the method name. The tokenizer and its methods are now public.
139:        //
140:        // Revision 1.1.2.3  2000/11/21 14:37:08  groos
141:        // added method realField(Class c, long fieldID) which returns the corresponding Field object.
142:        //
143:        // Revision 1.1.2.2  2000/11/13 18:59:16  popovici
144:        // severe bug in 'realMethods' fixed. The tokenization used to parse the
145:        // singature using normal chars lieke 'L' or 'B' which  could have beend
146:        // in the name of normal classes. A SignatureTokenizer was added.
147:        //
148:        // Revision 1.1.2.1  2000/10/24 18:08:30  popovici
149:        // Minor documentation fix.
150:        //
151:        // Revision 1.1  2000/10/16 11:48:24  popovici
152:        // InitialRevision
153:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.