Saturday 16 August 2014

Reflections

Reflections

      Reflections
      Getting the class object
      Find the Package details
      Get the Super class of this class
      Interfaces implemented by this class
      Get all the constructors declared in this class
      Fields accessing using reflection
            Getting and Setting Field Values
      Accessing Private fields
      Reflection - Methods
            Get Method Parameters and Return Type
            Invoke Method using Method Object
            Invoke static methods using Reflection
            Accessing Private Methods
      Reflections and Annotations
            Accessing class Annotations
            Accessing Method Annotations
            Accessing Field Annotations
            Accessing Parameter Annotations
            Check whether a field is annotated with given annotation or not
      Reflections and Arrays
      Class Loaders
            Explicit vs Implicit class loading
      Change the value of final variable
      When is InstantiationException thrown?
      newInstance(): Create an instance of the class
      Constructor: Define an object using constructor arguments
      How to check given object is primitive or not?
      isInstance(): Check object compatibility of a class
      instanceof vs isInstance()
      Check whether an array is of primitive type or not
      Check whether an array is a primitive wrapper array or not
      Dynamic proxies
      Set value to object property
      get value of object property
      Java: Get all the fields and inherited fields of a class
      Java: get the public static final constant variable name by its value
      Java: Get the field data type using reflection
      getMethods() vs getDeclaredMethods() in Java reflection
      How to check whether a method exists in a Java class or not?
      How to get the generic arguments of a method return type
      Unset the properties of given type using reflection in Java
      Utility class to work with reflections in Java
      Utility class to generate getter and setter methods for a class property
      Utility class to get detailed information about the properties of a class

No comments:

Post a Comment