/** Stop timing an item and store the information. **/ public void endItem() { ++numEnds; Item item = getLastNotEnded(); if (item != null) { item.end(); } ++numActualEnds; }
private static String toString(Object obj, boolean doSuperClasses) { try { return getFieldInfo(obj, doSuperClasses).toString(); } catch (ObjectAnalyzerException e) { return e.getMessage(); } }
/** * Get a localized string from the package of the default class. * @param key The name of the resource to fetch * @param defaultValue The default return value if not found * @return The localized string */ public String getLocalString(String key, String defaultValue) { return getLocalString(null, key, defaultValue); }
/** * No instances are allowed so it is pointless to override toString * @return Parsed version numbers */ public static String toStringStatic() { return "major: " + JDK.getMajor() + "\nminor: " + JDK.getMinor() + "\nsubminor: " + JDK.getSubMinor() + "\nupdate: " + JDK.getUpdate() + "\nOK ==>" + JDK.ok(); }
/** * @param obj * @return */ public static String toStringWithSuper(Object obj) { return toString(obj, true); }
public static void dprintStackTrace(PrintStream out, int frame, String title, String msg, Throwable excp) { if (isDebugMode()) { if (out == null) { out = printStackTrace_Stream; } if ((out != null) && (out != System.out) && (out != System.err)) { String m = (excp != null)? (msg + " (" + excp + ")") : msg; Print.println(null, frame + 1, "{log} " + m); } _printStackTrace(out, frame + 1, title, msg, excp); } }
/** * @param obj * @return */ public static String getMethods(Object obj) { return getMethods(obj, false); }
/** Start timing an item. **/ public void beginItem() { beginItem("No Description"); }
public static void dprint(String msg) { if (isDebugMode()) { print(null, msg); } }
/** Get the original troublemaker. @param e the Exception to dig into @return the original Throwable that started the problem */ public static Throwable getRootCause(final Throwable e) { final Throwable[] causes = getCauses(e); return (causes[causes.length - 1]); }
/** return a String report of all the timings * @return */ public static String report() { return profiler.toString(); }
/** * Create a new LoginException object with the given authentication * value. * @param The AuthenticationStatus object */ public LoginException(boolean as){ super(localStrings.getLocalString("enterprise.security.login_failed", "Login Failed.")); status = as; }
@Override public String toString() { return ObjectAnalyzer.toString(this); } ///////////////////////////////////////////////////////////////////////////
private static String toString(Object obj, boolean doSuperClasses) { try { return getFieldInfo(obj, doSuperClasses).toString(); } catch(ObjectAnalyzerException e) { return e.getMessage(); } }
/** Stop timing an item and store the information. **/ public void endItem() { ++numEnds; Item item = getLastNotEnded(); if (item != null) { item.end(); } ++numActualEnds; }
/** * @param clazz * @return */ public static String getSetters(Class clazz) { return getMethods(clazz, true); }
private static String toString(Object obj, boolean doSuperClasses) { try { return getFieldInfo(obj, doSuperClasses).toString(); } catch (ObjectAnalyzerException e) { return e.getMessage(); } }
/** Stop timing an item and store the information. **/ public void endItem() { ++numEnds; Item item = getLastNotEnded(); if (item != null) { item.end(); } ++numActualEnds; }