repository.grepcode.com$java$root@jdk$openjdk@6-b14
repository.grepcode.com$java$root@jdk$openjdk@6-b14@java$lang$reflect$Type.java
file
oh
o
[]
Here's a Java generic pattern:
public <T> T getResultData(Class<T> resultClass, other_args) {
...
return resultClass.cast(T-thing);
}
A typical call looks like:
DoubleBuffer buffer;
buffer = thing.getResultData(DoubleBuffer.class, args);
I've never been able to figure out how to use this pattern cleanly when the desired return type is, itself, generic. To be 'conc...
I have been trying to determine the type of a field in a class. I've seen all the introspection methods but haven't quite figured out how to do it. This is going to be used to generate xml/json from a java class. I've looked at a number of the questions here but haven't found exactly what I need.
Example:
class Person {
public final String name;
public final List<Person> childre...
Is there a common reflection approach to find out whether java method returns a set of objects like array, list, set, collection and other iterable subinterfaces?
The story behind is that I need to inspect third-party method's return type and say two things:
Does method return set of objects (in
human sense)?
If yes - what is the component type?
For example if method's return type is Vecto...
package java.lang.reflect;
Type is the common superinterface for all types in the Java
programming language. These include raw types, parameterized types,
array types, type variables and primitive types.