|
SoftNet-Consult Java Utility Library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softnetConsult.utils.reflect.ClassTools
public final class ClassTools
Defines static utilities for dealing with classes and reflection.
This product includes software developed by the
SoftNet-Consult Java Utility Library project and its contributors.
(http://java-tools.sourceforge.net)
Copyright (c) 2007-2008 SoftNet-Consult.
Copyright (c) 2007-2008 G. Paperin.
All rights reserved.
File: ClassTools.java
Library API version: "2.02"
Java compliance version: "1.5"
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following terms and conditions are met:
1. Redistributions of source code must retain the above
acknowledgement of the SoftNet-Consult Java Utility Library project, the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above acknowledgement of the
SoftNet-Consult Java Utility Library project, the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
3. All advertising materials mentioning features or use of this software or any derived
software must display the following acknowledgement:
This product includes software developed by the SoftNet-Consult Java Utility Library
project and its contributors.
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Field Summary | |
---|---|
static int |
JAVA_CLASSFILE_MAGIC_NUMBER
The magic number that must be contained in the first two bytes of all Java class binaries. |
Constructor Summary | |
---|---|
private |
ClassTools()
Prevents instances of this class from being created as this class contains only static utility methods. |
Method Summary | |
---|---|
static ClassVersionInfo |
getClassVersionInfo(java.io.InputStream classdata)
Parses the version information from a a Java class binary. |
static java.lang.String |
getMinimumRequiredJavaVersion(int classBinaryMajorVersion,
int classBinaryMinorVersion)
Determines the minimum JVM version required to run a class binary of the specified version. |
static java.lang.Class<?> |
getWrapperClass(java.lang.Class<?> type)
Find the correct wrapper class for a primitive type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int JAVA_CLASSFILE_MAGIC_NUMBER
Constructor Detail |
---|
private ClassTools()
Method Detail |
---|
public static java.lang.Class<?> getWrapperClass(java.lang.Class<?> type)
int
=> Integer.class
double
=> Double.class
Object
=> Object
null
=> null
type
- An object representing a Java class or interface.
public static final java.lang.String getMinimumRequiredJavaVersion(int classBinaryMajorVersion, int classBinaryMinorVersion)
classBinaryMajorVersion
- Major version of a class binary.classBinaryMinorVersion
- Minor version of a class binary.
"<unknown>"
is returned.public static ClassVersionInfo getClassVersionInfo(java.io.InputStream classdata) throws java.io.IOException
classdata
- A stream containing the Java class binary data.
java.io.IOException
- If an error occurs when reading from the specified class binary stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |