Here you can find the source of trace(Object object)
public static void trace(Object object)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import org.mozilla.javascript.NativeArray; import org.mozilla.javascript.NativeObject; public class Main { public static void trace(Object object) { trace(object, ""); }//from w w w . ja v a 2s . c om private static void trace(Object object, String spacing) { if (object instanceof NativeArray) { NativeArray arr = (NativeArray) object; for (Object o : arr) { trace(o, spacing + " "); } return; } if (object instanceof NativeObject) { NativeObject nativeObj = (NativeObject) object; System.out.println(spacing + "Class: " + nativeObj.getClassName()); for (Object key : nativeObj.keySet()) { System.out.println(spacing + "[Key: " + key + "]"); trace(nativeObj.get(key), spacing + " "); } return; } if (isJavaPrimitive(object)) { System.out.println(spacing + object); } else { // System.out.println(spacing + ToStringBuilder.reflectionToString(object)); } } private static boolean isJavaPrimitive(Object object) { return object instanceof String || object instanceof Integer || object instanceof Float || object instanceof Double || object instanceof Boolean || object instanceof Long || object instanceof Byte || object instanceof Character; } }