/** * Returns a new ClassTool instance that is inspecting the * Class of the specified {@link Object}. If the specified object * is null, then this will return {@code null}. All other * configuration settings will be copied to the new instance. * @param obj object instance to inspect * @return new class tool */ public ClassTool inspect(Object obj) { if (obj == null) { return null; } return inspect(obj.getClass()); }
/** * Returns a new ClassTool instance that is inspecting the * superclass of the Class being inspected by this instance. * If the current inspectee has no super class, * then this will return {@code null}. All other * configuration settings will be copied to the new instance. * @return parent class tool */ public ClassTool getSuper() { Class sup = getType().getSuperclass(); if (sup == null) { return null; } return inspect(sup); }
/** * Returns a new ClassTool instance that is inspecting the * Class with the specified name. If the specified Class cannot * be found, then this will return {@code null}. All other * configuration settings will be copied to the new instance. * @param name class name * @return new class tool */ public ClassTool inspect(String name) { if (name == null) { return null; } return inspect(toClass(name)); }