Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
Java
Reflection 322 codes
Home
Java
Reflection
1 A better concise toString method for annotation types
2 A class loader which loads classes using a searchlist of other classloaders
3 A class to simplify access to resources through the classloader
4 A demonstration of a proxy factory
5 A dynamic proxy adapter which allows overriding several methods of a target proxy
6 A high-performance factory for dynamic proxy objects
7 A wrapper around reflection to resolve generics
8 Access the enclosing class from an inner class
9 Accessible Field Iterator
10 Adds all Constructor (from Class getConstructorCalls) to the list
11 Adds all Fields (from Class getFields) to the list
12 Adds all methods (from Class getMethodCalls) to the list
13 Adds all static Fields (from Class getFields) to the list
14 Adds all static methods (from Class getMethodCalls) to the list
15 Adds the class SimpleNames, comma sepearated and surrounded by paranthesis to the call StringBuffer
16 All Fields Snippet
17 All information about a class
18 Allows the user to reflectively inspect an object hierarchy
19 Although the type of o2 is an interface, getSuperclass() returns the objects superclass
20 An invocation handler that counts the number of calls for all methods in the target class
21 Analyze ClassLoader hierarchy for any given object or class loader
22 Array Reflection
23 Attempt to find the given className within any of the packages
24 Attempts to list all the classes in the specified package as determined by the context class loader
25 Call a class method with 2 arguments
26 Call a member function to get the value
27 Call a method dynamically (Reflection)
28 Call a method of an object
29 Call a static method of a class with reflection
30 Call private method
31 Check if the given object is an array (primitve or native)
32 Check whether given exception is compatible with the exceptions declared in a throws clause
33 Check whether the given String is a valid identifier according to the Java Language specifications
34 Checks if class in member of the package
35 Checks whether the specified class contains a field matching the specified name
36 Checks whether the specified class contains a method matching the specified name
37 Class comparator
38 Class Declaration Spy
39 Class file reader for obtaining the parameter names for declared methods in a class
40 Class Finder
41 Class For Name
42 Class Reflection
43 Classpath Utils
44 Constructor Reflection
45 Contains Same Field Name
46 Contains Same Method Signature
47 Context ClassLoader
48 Convert a given String into the appropriate Class
49 Convert method to property name
50 Convert the constructor to a Java Code String (arguments are replaced by the simple types)
51 Convert the Method to a Java Code String (arguments are replaced by the simple types)
52 Create a new instance given a class name
53 Create a unique hash for Constructor and method
54 Create an object from a string
55 Create new instance and invoke methods
56 Create object using Constructor object
57 Creating a Proxy Object
58 Creating an Array
59 Creating an Object Using a Constructor Object
60 CrossRef prints a cross-reference about all classes named in argv
61 Data type utilities
62 Deal with enum type and its method
63 Deal with enum type field
64 Deal with Enum Type in reflection
65 Default values in an annotation
66 Demonstrate classFor to create an instance of an object
67 Demonstrates a dangerous use of proxy names
68 Demonstrates dynamic usage of methods
69 Demonstrates how to get declaration information on a Class
70 Demonstrates how to get specific method information
71 Demonstrates the basic concept of proxies generated by clients to the proxies
72 Demonstration of speed of reflexive versus programmatic invocation
73 Demonstration of various method invocation issues
74 Detect if a package is available
75 Determine the Superclass of an Object
76 Determine whether the supplied string represents a well-formed fully-qualified Java classname
77 Determines if the specified string is permissible as a Java identifier
78 Determining from Where a Class Was Loaded
79 Determining If a Class Object Represents a Class or Interface
80 Determining If an Object Is an Array
81 Does a method have an annotation
82 Does Class Exist
83 Dump a class using Reflection
84 Dynamically Reloading a Modified Class
85 Encapsulates a class serialVersionUID and codebase
86 Enum Spy
87 Enum type as class
88 Equivalently to invoking Thread currentThread() getContextClassLoader() loadClass(className); but it supports primitive types a
89 Escape Java Literal
90 Fast Property accessor for a single class
91 Fetches all fields of all access types from the supplied class and super classes
92 Fetches all methods of all access types from the supplied class and super classes
93 Fetches the property descriptor for the named property of the supplied class
94 Field modifiers
95 Field Reflection
96 Field with annotations
97 Find a Method on the supplied class with the supplied name and no parameters
98 Find a Method on the supplied class with the supplied name and parameter types
99 Find a setter method for the give objects property and try to call it
100 Find an accessible method passed in
101 Find Annotated Fields
102 Find Annotated Method
103 Find Declared Methods
104 Find Field
105 Find field 2
106 Find Inherited Field
107 Find Inherited Method
108 Find method
109 Find method 2
110 Find occurrencens of a classname in system classpath or the specified ClassLoader
111 Find the Package of an Object
112 For the primitive tipe the interface will be an empty array
113 Force the given class to be loaded fully
114 Format a string buffer containing the Class, Interfaces, CodeSource, and ClassLoader information for the given object clazz
115 Generic Class reflection
116 Generic method reflection
117 Get a compatible constructor for the given value type
118 Get a given method, and invoke it
119 Get a variable value from the variable name
120 Get Actual Class
121 Get all construtors from a class
122 Get all declared fields from a class
123 Get all declared methods from a class
124 Get all fields of a class
125 Get all implemented generic interfaces
126 Get all information about a package
127 Get all interface and object classes that are generalizations of the provided class
128 Get all methods including the inherited method Using the getMethods(), we can only access public methods
129 Get all methods of a class
130 Get all object accessible public fields
131 Get and set value of a Enum type field
132 Get Annotated Declared Fields
133 Get annotation by annotation class
134 Get Annotation Parameter
135 Get annotation value
136 Get class fieldproperty
137 Get Color
138 Get constructors of a class object
139 Get declared methods for enum class
140 Get default annotation value
141 Get Exception Types and get Generic Exception Types
142 Get field of a class object and set or get its value
143 Get field type and generic type by field name
144 Get fields of a class object
145 Get full package name
146 Get Generic Parameter Types from Constructor
147 Get Generic Super class
148 Get Generic Type
149 Get non Package Qualified Name
150 Get package by name
151 Get package name of a class
152 Get Package Names From Dir
153 Get Parameter Types and get Generic ParameterTypes
154 Get Parameterized Type
155 Get Raw Class
156 Get Return Type and get Generic Return Type
157 Get StackTraceElement
158 Get Static Method
159 Get Super Interfaces
160 Get the class By way of a string
161 Get the class By way of an object
162 Get the class By way of class
163 Get the class name in a static method
164 Get the class name with or without the package
165 Get the current method name
166 Get the current method name With JDK1 5
167 Get the fully-qualified name of a class
168 Get the fully-qualified name of a inner class
169 Get the methods of a class object
170 Get the name of a primitive type
171 Get the name of an array
172 Get the name of void
173 Get the path from where a class is loaded
174 Get the short name of the specified class by striping off the package name
175 Get the unqualified name of a class
176 Get Unqualified Name
177 GetPackage() returns null for a class in the unnamed package
178 GetPackage() returns null for a primitive type or array
179 Gets a method and forces it to be accessible, even if it is not
180 Gets a String array of all method calls for the given class
181 Gets an array of all Constructor calls for the given class
182 Gets the getters of a pojo as a map of String as key and Method as value
183 Gets the setters of a pojo as a map of String as key and Method as value
184 Getting a Constructor of a Class Object
185 Getting and Setting the Value of an Element in an Array Object
186 Getting the Component Type of an Array Object
187 Getting the Field Objects of a Class Object
188 Getting the Length and Dimensions of an Array Object
189 Getting the Methods of a Class Object
190 Getting the Package of a Class
191 Getting the Superclass of a Class Object
192 Getting the Superclass of an Object
193 Has Declared Constructor
194 How to set public field objects
195 If a class object is an interface or a class
196 If right-hand side type may be assigned to the left-hand side type following the Java generics rules
197 Instantiate unknown class at runtime and call the objects methods
198 Invoke a method using Method class
199 Invoke method through Java Reflection API
200 Invokes a method, masking with a runtime exception all the exceptions
201 Is Accessible
202 Is Checked Exception
203 Is Field Annotation Present
204 Is Inheritable
205 Is it an enum
206 Is Java Identifier and get Java Identifier
207 Is Primitive type, get Primitive Class, get Type Default Value
208 Is the given {@code object} a primitive type or wrapper for a primitive type
209 Is the Same Signature
210 Is Type Compatible
211 IsTypeOf
212 Jar Class Loader
213 Java interpreter replacement
214 JavaP prints structural information about classes
215 Listing the Interfaces That a Class Implements
216 Listing the Interfaces That an Interface Extends
217 Listing the Modifiers of a Class Object
218 Listing the Modifiers of a Member Object
219 Load a class given its name
220 Load a method on the fly
221 Load Class
222 Load class from Threads ContextClassLoader, classloader of derived class or the system ClassLoader
223 Load classes
224 Load the class source location from Class getResource()
225 Loading a Class That Is Not on the Classpath
226 Locates generic declaration by index on a class
227 Maintains a mapping of service names to an ordered set of service providers when running in an OSGi container
228 Make field accessible, explicitly setting it accessible
229 Make methods that have unspecified number of parameters
230 Make up a compilable version of a given Sun or other API
231 Manipulate Java class files in strange and mysterious ways
232 Manipulate Java classes
233 Method modifiers
234 Method Reflection
235 Method signature
236 Modifier check utility
237 Object Reflection
238 Obtain from where a Class is loaded
239 Overriding Default Access
240 Package Utils
241 Parses the CLASSPATH and returns the directories used within it
242 Passing a parameter to the constructor and calling a method dynamically
243 Process bean properties getter by applying the JavaBean naming conventions
244 Provides a set of static methods that extend the Java metaobject
245 Reflect1 shows the information about the class named in argv
246 Resolve class and load class
247 Responsible for loading (class) files from the CLASSPATH Inspired by sun tools ClassPath
248 Retrieve a value from a property
249 Retrieving a Predefined Color by Name
250 Retrieving other information through the class pointer
251 Return a list of all fields (whatever access status, and on whatever superclass they were defined) that can be found on this cl
252 Return a List of super-classes for the given class
253 Return a paranthesis enclosed, comma sepearated String of all SimpleClass names in params
254 Return a String representation of an objects overall identity
255 Return an Object array for the given object
256 Return Retrurns the Type of the given Field or Method
257 Return the context classloader
258 Return true if class a is either equivalent to class b, or if class a is a subclass of class b, i e if a either extends or impl
259 Return true if the integer argument includes the abstract modifier, false otherwise
260 Return true if the integer argument includes the final modifier, false otherwise
261 Return true if the integer argument includes the private modifier, false otherwise
262 Return true if the integer argument includes the protected modifier,false otherwise
263 Return true if the integer argument includes the public modifier, false otherwise
264 Return true if the integer argument includes the static modifier, false otherwise
265 Returns an array of Type objects representing the actual type arguments to targetType used by clazz
266 Returns an instance of the given class name, by calling the default constructor
267 Returns attributes getter method If the method not found then NoSuchMethodException will be thrown
268 Returns attributes setter method If the method not found then NoSuchMethodException will be thrown
269 Returns method with the specified name
270 Returns the class defined for the type variable
271 Returns the name of a class without the package name
272 Returns the package portion of the specified class
273 Returns the type of the field of return type of a method
274 Returns true if a class implements Serializable and false otherwise
275 Returns true if type is a iterable type
276 Returns true if type is implementing Map
277 Search Method
278 Search over classpath retrieving classes that implement a certain interface
279 Set Accessibility
280 Set private field value
281 Set the value of the field of the object to the given value
282 Show a couple of things you can do with a Class object
283 Show all annotations for a class and a method
284 Show loading a class and finding and calling its Main method
285 Show that you can, in fact, take the class of a primitive
286 Show the class keyword and getClass() method in action
287 Show the Packages
288 Simple Demonstration of a ClassLoader WILL NOT COMPILE OUT OF THE BOX
289 Sorts methods according to their name, number of parameters, and parameter types
290 Superclass of Object is null
291 The interfaces for a primitive type is an empty array
292 The next example calls a class method with 2 arguments
293 The superclass of interfaces is always null
294 The superclass of primitive types is always null
295 This class shows using Reflection to get a field from another class
296 This program demonstrates the use of proxies and reflection
297 This program demonstrates the use of reflection for manipulating arrays
298 This program shows how to invoke methods through reflection
299 This program uses reflection to print all features of a class
300 This program uses reflection to spy on objects
301 To get the calling method
302 To Identifier String
303 To Package Path
304 TYPE Utilities
305 Unqualified names
306 Use reflection to access the true classpath info
307 Use reflection to dynamically discover the capabilities of a class
308 Use reflection to get console char set
309 Uses reflection and JavaBeans introspection to
310 Uses reflection to display the annotation associated with a method
311 Using Reflection to browse a java class
312 Using reflection to check array type and length
313 Using reflection to create, fill, and display an array
314 Using reflection to show all the methods of a class
315 Using the forName() method
316 Utilities to use Java reflection without all of the checked exceptions
317 Utility class for working with Java types
318 Utility to essentially do Class forName and allow configurable Classloaders
319 Various Class Loader utilities
320 Whether given field is a public static final constant
321 Whether method declares the given exception or one of its superclasses
322 Zip Class Loader