de.esprit.common.util

## Class ClassUtil

- java.lang.Object
- - de.esprit.common.util.ClassUtil

-     public class ClassUtil
      extends java.lang.Object

  This class contains utility methods for introspecting java classes.
  Author:
    Rainer Buesch

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `createClassFilePath(java.lang.Class c)` Returns the relative pathname of a class as a file path (separated with '/')
    `static java.lang.String` | `createFullClassName(java.lang.String pkgPath, java.lang.String simpleClassName)` Returns a fully qualified class name.
    `static java.lang.String` | `createPackageFilePath(java.lang.Class c)` Returns the relative package path of a class as a file path (separated with '/')
    `static java.lang.String` | `createPackagePath(java.lang.Class c)` Returns the package pathname of a class as a file path (separated with '/')
    `static java.lang.String` | `createPackagePath(java.lang.Object obj)` Returns the objects class.pathname as a file path (separated with '/')
    `static java.lang.String` | `createSourceFilePath(java.lang.Class c)` Returns the relative pathname of a java source file as a file path (separated with '/')
    `static java.lang.reflect.Constructor` | `findConstructor(java.lang.Class thisClass, java.lang.Class paramType)` Finds the constructor in thisClass that matches the parameter type paramType
    `static java.lang.reflect.Constructor` | `findConstructor(java.lang.Class thisClass, java.lang.Class[] paramTypes)` Finds the constructor in thisClass that matches all the given parameter types
    `static java.lang.String` | `getAnnotationValue(java.lang.annotation.Annotation anno, java.lang.String annoVarName)` Returns the value of the variable of the given annotation.
    `static boolean` | `isFloatingPointType(java.lang.Class c)`
    `static boolean` | `isImplementing(java.lang.Class theClass, java.lang.Class theInterface)`
    `static boolean` | `isIntegerType(java.lang.Class c)`
    `static boolean` | `isNumericType(java.lang.Class c)`
    `static boolean` | `isSubClassOf(java.lang.Object obj, java.lang.Class otherClass)` Tests if the given object is an instance of a sub-class of otherClass.
    `static int` | `sizeOfObject(java.lang.Object src)` This method serializes an object in order to figure out how much memory it consumes.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getAnnotationValue

          public static java.lang.String getAnnotationValue(java.lang.annotation.Annotation anno,
                                            java.lang.String annoVarName)
                                                     throws java.lang.Exception

      Returns the value of the variable of the given annotation.
      Throws:
        `java.lang.Exception`

    - #### isSubClassOf

          public static boolean isSubClassOf(java.lang.Object obj,
                             java.lang.Class otherClass)

      Tests if the given object is an instance of a sub-class of otherClass.

    - #### isImplementing

          public static boolean isImplementing(java.lang.Class theClass,
                               java.lang.Class theInterface)

    - #### findConstructor

          public static java.lang.reflect.Constructor findConstructor(java.lang.Class thisClass,
                                                      java.lang.Class paramType)

      Finds the constructor in thisClass that matches the parameter type paramType
      Returns:
        the matching constructor, null if not found.

    - #### findConstructor

          public static java.lang.reflect.Constructor findConstructor(java.lang.Class thisClass,
                                                      java.lang.Class[] paramTypes)

      Finds the constructor in thisClass that matches all the given parameter types
      Returns:
        the matching constructor, null if not found.

    - #### isIntegerType

          public static boolean isIntegerType(java.lang.Class c)

    - #### isFloatingPointType

          public static boolean isFloatingPointType(java.lang.Class c)

    - #### isNumericType

          public static boolean isNumericType(java.lang.Class c)

    - #### createClassFilePath

          public static java.lang.String createClassFilePath(java.lang.Class c)

      Returns the relative pathname of a class as a file path (separated with '/')

    - #### createPackageFilePath

          public static java.lang.String createPackageFilePath(java.lang.Class c)

      Returns the relative package path of a class as a file path (separated with '/')

    - #### createSourceFilePath

          public static java.lang.String createSourceFilePath(java.lang.Class c)

      Returns the relative pathname of a java source file as a file path (separated with '/')

    - #### createPackagePath

          public static java.lang.String createPackagePath(java.lang.Class c)

      Returns the package pathname of a class as a file path (separated with '/')

    - #### createPackagePath

          public static java.lang.String createPackagePath(java.lang.Object obj)

      Returns the objects class.pathname as a file path (separated with '/')

    - #### createFullClassName

          public static java.lang.String createFullClassName(java.lang.String pkgPath,
                                             java.lang.String simpleClassName)

      Returns a fully qualified class name. All occurrences of '\' or '/' in pgkPath are replaced by '.'

    - #### sizeOfObject

          public static int sizeOfObject(java.lang.Object src)

      This method serializes an object in order to figure out how much memory it consumes.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.