GATE
Version 3.1-2270

debugger
Class ClassRipper

java.lang.Object
  extended by debugger.ClassRipper

public class ClassRipper
extends Object

Copyright (c) Ontos AG (http://www.ontosearch.com). This class is part of JAPE Debugger component for GATE (Copyright (c) "The University of Sheffield" see http://gate.ac.uk/)
Contains helper static methods to access private class fields

Author:
Andrey Shafirin

Method Summary
static boolean getBoolean(Object classInstance, String fieldName)
           
static byte getByte(Object classInstance, String fieldName)
           
static char getChar(Object classInstance, String fieldName)
           
static double getDouble(Object classInstance, String fieldName)
           
static Object getFieldValue(Object classInstance, String fieldName)
          Obtains field value from given class instance regardless either this field private or not
static float getFloat(Object classInstance, String fieldName)
           
static int getInt(Object classInstance, String fieldName)
           
static long getLong(Object classInstance, String fieldName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFieldValue

public static Object getFieldValue(Object classInstance,
                                   String fieldName)
                            throws IllegalAccessException
Obtains field value from given class instance regardless either this field private or not

Parameters:
classInstance - class instance which value to extract
fieldName - field name
Returns:
fileld value
Throws:
IllegalAccessException

getBoolean

public static boolean getBoolean(Object classInstance,
                                 String fieldName)
                          throws IllegalAccessException
Throws:
IllegalAccessException

getByte

public static byte getByte(Object classInstance,
                           String fieldName)
                    throws IllegalAccessException
Throws:
IllegalAccessException

getChar

public static char getChar(Object classInstance,
                           String fieldName)
                    throws IllegalAccessException
Throws:
IllegalAccessException

getInt

public static int getInt(Object classInstance,
                         String fieldName)
                  throws IllegalAccessException
Throws:
IllegalAccessException

getFloat

public static float getFloat(Object classInstance,
                             String fieldName)
                      throws IllegalAccessException
Throws:
IllegalAccessException

getLong

public static long getLong(Object classInstance,
                           String fieldName)
                    throws IllegalAccessException
Throws:
IllegalAccessException

getDouble

public static double getDouble(Object classInstance,
                               String fieldName)
                        throws IllegalAccessException
Throws:
IllegalAccessException

GATE
Version 3.1-2270