public class ObjOut extends Object
ObjOut.to("out.c").skip(session).prune("-com.ibm").dump(request, response)
.Modifier and Type | Class and Description |
---|---|
protected static interface |
ObjOut.Handler |
protected class |
ObjOut.OutputDriver |
protected class |
ObjOut.OutputDriverHtml |
protected static class |
ObjOut.StdHandler |
Modifier and Type | Field and Description |
---|---|
protected HashMap<Object,Object> |
equs |
protected boolean |
includeStatic |
protected static HashMap<Class<?>,Field[]> |
knownFields |
protected HashMap<Class<?>,ObjOut.Handler> |
knownHandlers |
protected int |
level |
protected int |
maxLevel |
protected int |
maxLevelReached |
protected boolean |
mustClose |
protected int |
numExceptions |
protected int |
numLevelExceeded |
protected ObjOut.OutputDriver |
odrv |
protected ArrayList<Pair<String,Boolean>> |
pruningRules |
protected PrintStream |
ps |
protected IdentityHashMap<Object,Integer> |
seen |
Constructor and Description |
---|
ObjOut()
Builds a dumper targeting System.out, pruning java.* and javax
|
Modifier and Type | Method and Description |
---|---|
protected Integer |
assignOid(Object o) |
protected Integer |
assignOrRetrieveOid(Object o) |
protected void |
checkEqualities(Class<?> c,
Object o) |
String |
dump(Object... os)
Dump passed objects to the pre-set stream, if it is not null.
|
protected void |
dump(String name,
Class<?> expected,
Object o,
boolean endWithNewLine) |
String |
dumpField(Object o,
String field) |
String |
dumpWithMem(boolean forget,
Object... os)
Dump passed objects to the pre-set stream, if it is not null.
|
protected boolean |
enterObjectContent(Object o,
Class<?> c)
Decide whether to actually drill down to an object's content (returning true/false accordingly)
and if so, prints an opening text and update the level.
|
protected Field[] |
getFieldsFor(Object o,
Class<?> c) |
protected ObjOut.Handler |
getHandlerFor(Object o,
Class<?> c) |
int |
getMaxLevel() |
ObjOut |
html() |
protected void |
leaveObjectContent(boolean endWithNewLine) |
ObjOut |
noStatics() |
protected void |
prclass(Class<?> c) |
protected void |
printValue(Class<?> c,
Object o,
boolean endWithNewLine) |
ObjOut |
prune(String rules)
Adds pruning rules based on package names.
|
protected Field[] |
rawGetFieldsFor(Object o,
Class<?> c) |
ObjOut |
resetPruning() |
ObjOut |
setMaxLevel(int maxLevel) |
protected boolean |
shouldPrune(String className) |
ObjOut |
skip(Object... os)
Records passed objects to the 'already seen' list, causing their content to
be skipped when dumping later on. e.g :
new ObjOut().to("file.c").skip(session).dump(request) |
ObjOut |
statics() |
ObjOut |
text() |
static ObjOut |
to(File f)
Sets this dumper to output to a file
|
static ObjOut |
to(OutputStream os,
boolean mustClose)
Sets this dumper to output to a stream
|
ObjOut |
to(PrintStream newPs,
boolean newMustClose)
Sets this dumper to output to a given print stream and replaces previous values of ps and mustClose.
|
static ObjOut |
to(String fileName)
Sets this dumper to output to the file specified by its name
|
static ObjOut |
to(Writer w,
boolean mustClose)
Sets this dumper to output to a stream
|
static String |
toString(Object o)
Convenience method to automatically do a toString on an object.
|
static String |
toString(Object o,
int maxLevel)
Convenience method to automatically do a toString at maxLevel of introspection on an object.
|
protected final HashMap<Class<?>,ObjOut.Handler> knownHandlers
protected PrintStream ps
protected boolean mustClose
protected int maxLevel
protected boolean includeStatic
protected IdentityHashMap<Object,Integer> seen
protected int level
protected int maxLevelReached
protected int numExceptions
protected int numLevelExceeded
protected ObjOut.OutputDriver odrv
public ObjOut()
public ObjOut resetPruning()
public ObjOut prune(String rules)
public ObjOut statics()
public ObjOut noStatics()
public ObjOut to(PrintStream newPs, boolean newMustClose)
public static ObjOut to(OutputStream os, boolean mustClose)
public static ObjOut to(String fileName)
public ObjOut skip(Object... os)
new ObjOut().to("file.c").skip(session).dump(request)
public String dump(Object... os)
public String dumpWithMem(boolean forget, Object... os)
forget
- if true, 'seen' objects are cleared.protected boolean shouldPrune(String className)
protected void prclass(Class<?> c)
protected ObjOut.Handler getHandlerFor(Object o, Class<?> c)
protected boolean enterObjectContent(Object o, Class<?> c)
protected void leaveObjectContent(boolean endWithNewLine)
public int getMaxLevel()
public ObjOut setMaxLevel(int maxLevel)
public ObjOut html()
public ObjOut text()
public static String toString(Object o, int maxLevel)