java.lang.reflect

Java Source Code / Java Documentation
1. JDK Core
2. JDK Modules
3. JDK Modules com.sun
4. JDK Modules com.sun.java
5. JDK Modules Platform
6. JDK Modules sun
7. Open Source Build
8. Open Source Graphic Library
9. Open Source IDE Eclipse
10. Open Source J2EE
11. Open Source JDBC Driver
12. Open Source Library
13. Open Source Library Database
14. Open Source Net
15. Open Source Script
16. Science
17. Security
18. Sevlet Container
19. SUN GlassFish
20. Swing Library
21. Web Services apache cxf 2.0.1
22. Web Services AXIS2
23. XML
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Java Source Code / Java Documentation » JDK Core » lang » java.lang.reflect 
java.lang.reflect
Provides classes and interfaces for obtaining reflective information about classes and objects.
Java Source File NameTypeComment
AccessibleObject.javaClass The AccessibleObject class is the base class for Field, Method and Constructor objects.
AnnotatedElement.javaInterface Represents an annotated element of the program currently running in this VM.
Array.javaClass The Array class provides static methods to dynamically create and access Java arrays.
Constructor.javaClass Constructor provides information about, and access to, a single constructor for a class.
Field.javaClass A Field provides information about, and dynamic access to, a single field of a class or an interface.
GenericArrayType.javaInterface GenericArrayType represents an array type whose component type is either a parameterized type or a type variable.
GenericDeclaration.javaInterface A common interface for all entities that declare type variables.
GenericSignatureFormatError.javaClass Thrown when a syntactically malformed signature attribute is encountered by a reflective method that needs to interpret the generic signature information for a type, method or constructor.
InvocationHandler.javaInterface InvocationHandler is the interface implemented by the invocation handler of a proxy instance.
InvocationTargetException.javaClass InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor.

As of release 1.4, this exception has been retrofitted to conform to the general purpose exception-chaining mechanism.

MalformedParameterizedTypeException.javaClass Thrown when a semantically malformed parameterized type is encountered by a reflective method that needs to instantiate it.
Member.javaInterface Member is an interface that reflects identifying information about a single member (a field or a method) or a constructor.
Method.javaClass A Method provides information about, and access to, a single method on a class or interface.
Modifier.javaClass The Modifier class provides static methods and constants to decode class and member access modifiers.
package-info.java
ParameterizedType.javaInterface ParameterizedType represents a parameterized type such as Collection<String>.

A parameterized type is created the first time it is needed by a reflective method, as specified in this package.

Proxy.javaClass Proxy provides static methods for creating dynamic proxy classes and instances, and it is also the superclass of all dynamic proxy classes created by those methods.

To create a proxy for some interface Foo :

 InvocationHandler handler = new MyInvocationHandler(...);
 Class proxyClass = Proxy.getProxyClass(
 Foo.class.getClassLoader(), new Class[] { Foo.class });
 Foo f = (Foo) proxyClass.
 getConstructor(new Class[] { InvocationHandler.class }).
 newInstance(new Object[] { handler });
 
or more simply:
 Foo f = (Foo) Proxy.newProxyInstance(Foo.class.getClassLoader(),
 new Class[] { Foo.class },
 handler);
 

A dynamic proxy class (simply referred to as a proxy class below) is a class that implements a list of interfaces specified at runtime when the class is created, with behavior as described below. A proxy interface is such an interface that is implemented by a proxy class. A proxy instance is an instance of a proxy class. Each proxy instance has an associated invocation handler object, which implements the interface InvocationHandler . A method invocation on a proxy instance through one of its proxy interfaces will be dispatched to the InvocationHandler.invokeinvoke method of the instance's invocation handler, passing the proxy instance, a java.lang.reflect.Method object identifying the method that was invoked, and an array of type Object containing the arguments.

ReflectAccess.javaClass Package-private class implementing the sun.reflect.LangReflectAccess interface, allowing the java.lang package to instantiate objects in this package.
ReflectPermission.javaClass The Permission class for reflective operations.
Type.javaInterface Type is the common superinterface for all types in the Java programming language.
TypeVariable.javaInterface TypeVariable is the common superinterface for type variables of kinds. A type variable is created the first time it is needed by a reflective method, as specified in this package.
UndeclaredThrowableException.javaClass Thrown by a method invocation on a proxy instance if its invocation handler's InvocationHandler.invoke invoke method throws a checked exception (a Throwable that is not assignable to RuntimeException or Error ) that is not assignable to any of the exception types declared in the throws clause of the method that was invoked on the proxy instance and dispatched to the invocation handler.

An UndeclaredThrowableException instance contains the undeclared checked exception that was thrown by the invocation handler, and it can be retrieved with the getUndeclaredThrowable() method. UndeclaredThrowableException extends RuntimeException , so it is an unchecked exception that wraps a checked exception.

As of release 1.4, this exception has been retrofitted to conform to the general purpose exception-chaining mechanism.

WildcardType.javaInterface WildcardType represents a wildcard type expression, such as ? , ? extends Number , or ? super Integer .
w_w__w.j__a_v__a_2__s.co___m___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.