Name Location Description
getClass() any Object Returns the Class object for actual type
getName() Class objects Return the full name of the class (“java.lang.String”)
getDeclaredFields() Class objects Return all fields as an array
getDeclaredMethods() Class objects Return all methods as an array
getModifiers() Field or Method Return the modifiers of the field. Use Modifier.is* to check that a modifier is set.
setAccessible(true) Field or Method Enables private fields and methods to be used by reflection.
get(Object obj) Field Gets the value of the field of an object
set(Object obj, Object value) Field Sets the value of the field of an object
getParameterTypes() Method Get an array of Class objects that are the types of the parameters for this method.
newInstance() Class objects Creates a new instance of the given class using the default (empty) constructor.
getAnnotation(Cls.class) Class, Field or Method Returns the annotation if the element is annotated with the given annotation, or null otherwise.
@RetentionRetentionPolicy.RUNTIME) Annotation class Declares that the annotation should be present at runtime.
@Target({ … }) Annotation class Declares what types of elements can be annotated with the annotation.