Source Code Cross Referenced for VMReflection.java in  » Apache-Harmony-Java-SE » java-package » java » lang » reflect » 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 » Apache Harmony Java SE » java package » java.lang.reflect 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */
017:        /**
018:         * @author Evgueni Brevnov
019:         * @version $Revision: 1.1.2.1.4.4 $
020:         */package java.lang.reflect;
021:
022:        /**
023:         * Provides the package private methods requirered for the
024:         * <code>java.lang.reflect</code> package implementation.
025:         * <p>
026:         * This class must be implemented according to the common policy for porting
027:         * interfaces - see the porting interface overview for more detailes.
028:         * <p>
029:         * <b>Note: </b> this class design is based on requirements for the
030:         * {@link Field}, {@link Method} and {@link Constructor} classes from the
031:         * <code>java.lang.reflect</code> package. Each class (Field, Method, Constructor)
032:         * should have a constructor that accepts an argument of the
033:         * {@link java.lang.Object} type. This argument serves as an identifier of
034:         * particular item. This identifier should be used later when one needs to 
035:         * operate with an item. For example, see {@link VMReflection#getFieldType(Object)
036:         * VMReflection.getFieldType(Object id)} method.
037:         * @api2vm
038:         */
039:
040:        final class VMReflection {
041:
042:            /**
043:             * This class is not supposed to be instantiated.
044:             */
045:            private VMReflection() {
046:            }
047:
048:            /**
049:             * This method satisfies the requirements of the specification for the
050:             * {@link Method#getExceptionTypes() Method.getExceptionTypes()} method. But
051:             * it takes one additional id parameter.
052:             * 
053:             * @param id an identifier of the caller class.
054:             * @api2vm
055:             */
056:            static native Class<?>[] getExceptionTypes(long id);
057:
058:            /**
059:             * This method satisfies the requirements of the specification for the
060:             * {@link Field#getType() Field.getType()} method. But it takes one
061:             * additional id parameter.
062:             * 
063:             * @param id an identifier of the caller class.
064:             * @api2vm
065:             */
066:            static native Class<?> getFieldType(long id);
067:
068:            /**
069:             * This method satisfies the requirements of the specification for the
070:             * {@link Method#getReturnType() Method.getReturnType()} method. But it
071:             * takes one additional id parameter.
072:             * 
073:             * @param id an identifier of the caller class.
074:             * @api2vm
075:             */
076:            static native Class<?> getMethodReturnType(long id);
077:
078:            /**
079:             * This method satisfies the requirements of the specification for the
080:             * {@link Method#getParameterTypes() Method.getParameterTypes()} method. But
081:             * it takes one additional id parameter.
082:             * 
083:             * @param id an identifier of the caller class.
084:             * @api2vm
085:             */
086:            static native Class<?>[] getParameterTypes(long id);
087:
088:            /**
089:             * This method satisfies the requirements of the specification for the
090:             * {@link Method#invoke(java.lang.Object, java.lang.Object[])
091:             * Method.invoke(Object obj, Object[] args)} method. But it differs in
092:             * several ways.
093:             * <p>
094:             * First, it takes one additional <code>id</code> parameter. This parameter
095:             * is used as an identifier to invoke corresponding method.
096:             * <p>
097:             * Second, it doesn't perform access control so it doesn't throw an
098:             * <code>IllegalAccessException</code> exception. 
099:             * <p>
100:             * Third, it throws <code>IllegalArgumentException</code> only if the
101:             * <code>args</code> argument doesn't fit to the actual method parameters.  
102:             * <p>
103:             * Last, it doesn't throw an <code>NullPointerException</code> exception. If
104:             * the <code>id</code> argument corresponds to a static method then the
105:             * object argument must be null. An attempt to invoke a static method will
106:             * be made in this case. If the <code>id</code> argument corresponds to a
107:             * non-static method then corresponding object's method will be invoked.
108:             * <p>
109:             * <b>Note:</b> Under design yet. Subjected to change.
110:             * 
111:             * @param id the identifier of the method to be invoked.
112:             * @api2vm
113:             */
114:            static native Object invokeMethod(long id, Object object,
115:                    Object... args) throws InvocationTargetException;
116:
117:            /**
118:             * This method satisfies the requirements of the specification for the
119:             * {@link Array#newInstance(Class, int[])
120:             * Array.newInstance(Class componentType, int[] dimensions)} method. But it
121:             * differs in several ways.
122:             * <p>
123:             * First, it it doesn't throw an <code>NullPointerException</code> exception.
124:             * <p>
125:             * Second, it throws an <code>IllegalArgumentException</code> exception only
126:             * if the implementation doesn't support specified number of dimensions.
127:             * <p>
128:             * <b>Note:</b> Under design yet. Subjected to change.
129:             * @api2vm
130:             */
131:            static native Object newArrayInstance(Class<?> type,
132:                    int[] dimensions);
133:
134:            /**
135:             * This method satisfies the requirements of the specification for the
136:             * {@link Constructor#newInstance(java.lang.Object[])
137:             * Constructor.newInstance(java.lang.Object[] initargs)} method. But it
138:             * differs in several ways.
139:             * <p>
140:             * First, it takes one additional <code>id</code> parameter. This parameter
141:             * is used as an identifier of the corresponding constructor.
142:             * <p>
143:             * Second, it doesn't perform access control so it doesn't throw an
144:             * <code>IllegalAccessException</code> exception.
145:             * <p>
146:             * Last, it doesn't throw an <code>InstantiationException</code> exception. 
147:             * The <code>id</code> argument must not correspond to an abstract class.
148:             * <p>
149:             * <b>Note:</b> Under design yet. Subjected to change.
150:             * 
151:             * @param id the identifier of the method to be invoked.
152:             * @api2vm
153:             */
154:            static native Object newClassInstance(long id, Object... args)
155:                    throws InvocationTargetException;
156:
157:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.