|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.openjpa.lib.util.JavaVersions
public class JavaVersions
Utilities for dealing with different Java spec versions.
Field Summary | |
---|---|
static int |
VERSION
Java version; one of 2, 3, 4, 5, 6, or 7. |
Constructor Summary | |
---|---|
JavaVersions()
|
Method Summary | |
---|---|
static java.lang.Throwable |
getCause(java.lang.Throwable ex)
Return the cause of the given throwable. |
static java.lang.Class[] |
getParameterizedTypes(java.lang.reflect.Field f)
Collects the parameterized type declarations for a given field. |
static java.lang.Class[] |
getParameterizedTypes(java.lang.reflect.Method meth)
Collects the parameterized return type declarations for a given method. |
static java.lang.Class |
getVersionSpecificClass(java.lang.Class base)
Returns a version-specific instance of the specified class |
static java.lang.Class |
getVersionSpecificClass(java.lang.String base)
Obtains a subclass of the specific base class that is specific to the current version of Java in use. |
static java.lang.Throwable |
initCause(java.lang.Throwable ex,
java.lang.Throwable cause)
Set the cause of the given throwable. |
static boolean |
isAnnotation(java.lang.Class cls)
Return true if the given type is an annotation. |
static boolean |
isEnumeration(java.lang.Class cls)
Return true if the given type is an enumeration. |
static void |
main(java.lang.String[] args)
|
static boolean |
transferStackTrace(java.lang.Throwable from,
java.lang.Throwable to)
Transfer the stack from one throwable to another, or return false if it cannot be done, possibly due to an unsupported Java version. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int VERSION
Constructor Detail |
---|
public JavaVersions()
Method Detail |
---|
public static java.lang.Class getVersionSpecificClass(java.lang.Class base)
base
- the base class to check
getVersionSpecificClass(String)
public static java.lang.Class getVersionSpecificClass(java.lang.String base) throws java.lang.ClassNotFoundException
VERSION
field, then each number in
decreasing order, until ending in the unqualified name.
For example, if we are using JDK 1.5.1, and we want to load
"org.apache.openjpa.lib.SomeClass", we will try to load the following
classes in order and return the first one that is successfully
found and loaded:
base
- the base name of the class to load
java.lang.ClassNotFoundException
public static boolean isAnnotation(java.lang.Class cls)
public static boolean isEnumeration(java.lang.Class cls)
public static java.lang.Class[] getParameterizedTypes(java.lang.reflect.Field f)
public static java.lang.Class[] getParameterizedTypes(java.lang.reflect.Method meth)
public static boolean transferStackTrace(java.lang.Throwable from, java.lang.Throwable to)
public static java.lang.Throwable getCause(java.lang.Throwable ex)
public static java.lang.Throwable initCause(java.lang.Throwable ex, java.lang.Throwable cause)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |