/** * Returns a new ClassTool instance that is inspecting the * the specified {@link Class}. If the specified class * is null, then this will return {@code null}. All other * configuration settings will be copied to the new instance. * If {@link #isSafeMode()} is {@code true} and the specified Class * is not declared {@code public}, then this will return * {@code null}. * @param type class to inspect * @return new class tool */ public ClassTool inspect(Class type) { if (type == null) { return null; } // create the new tool, but only return it if // it is public or isSafeMode() is off ClassTool tool = new ClassTool(this, type); if (isSafeMode() && !tool.isPublic()) { return null; } return tool; }