class Graphviz extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
baseFilename |
private static java.lang.String |
dirName |
static java.util.HashMap<java.lang.String,java.lang.String> |
fieldAttributeMap |
static java.util.HashMap<java.lang.String,java.lang.String> |
frameAttributeMap |
private static java.lang.String |
mainClassName |
private static int |
nextGraphNumber |
static java.util.HashMap<java.lang.String,java.lang.String> |
objectAttributeMap |
private static java.lang.String |
PREFIX_ARRAY |
private static java.lang.String |
PREFIX_EXCEPTION |
private static java.lang.String |
PREFIX_FRAME |
private static java.lang.String |
PREFIX_LABEL |
private static java.lang.String |
PREFIX_OBJECT |
private static java.lang.String |
PREFIX_RETURN |
private static java.lang.String |
PREFIX_STATIC |
protected static java.lang.String |
PREFIX_UNUSED_LABEL |
private static java.lang.String |
quotable |
static java.util.HashMap<java.lang.String,java.lang.String> |
staticClassAttributeMap |
Modifier | Constructor and Description |
---|---|
private |
Graphviz() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
canAppearUnquotedInLabel(char c) |
private static boolean |
canIgnoreObjectField(com.sun.jdi.Field field) |
private static boolean |
canIgnoreStaticField(com.sun.jdi.Field field) |
private static boolean |
canTreatAsPrimitive(com.sun.jdi.Value v) |
static void |
drawFrames(int start,
java.lang.String loc,
com.sun.jdi.Value returnVal,
com.sun.jdi.Value exnVal,
java.util.List<com.sun.jdi.StackFrame> frames,
java.util.Set<com.sun.jdi.ReferenceType> staticClasses) |
static void |
drawFramesCheck(java.lang.String loc,
com.sun.jdi.Value returnVal,
com.sun.jdi.Value exnVal,
java.util.List<com.sun.jdi.StackFrame> frames,
java.util.Set<com.sun.jdi.ReferenceType> staticClasses) |
static void |
drawObjects(java.lang.String loc,
java.util.Map<java.lang.String,com.sun.jdi.ObjectReference> objects) |
protected static void |
drawStuff(java.lang.String loc,
java.util.function.Consumer<java.io.PrintWriter> consumer) |
private static java.lang.String |
frameGvName(int frameNumber) |
private static boolean |
frameHasPrimitives(java.util.Map<com.sun.jdi.LocalVariable,com.sun.jdi.Value> ls) |
private static java.lang.String |
frameName(int frameNumber,
com.sun.jdi.StackFrame frame,
com.sun.jdi.Method method,
int lineNumber) |
private static void |
labelFrameWithNoPrimitiveLocals(int frameNumber,
com.sun.jdi.StackFrame frame,
java.io.PrintWriter out) |
private static void |
labelFrameWithSomePrimitiveLocals(int frameNumber,
com.sun.jdi.StackFrame frame,
java.util.Map<com.sun.jdi.LocalVariable,com.sun.jdi.Value> ls,
java.io.PrintWriter out) |
private static void |
labelObjectWithNoPrimitiveFields(com.sun.jdi.ObjectReference obj,
java.io.PrintWriter out) |
private static void |
labelObjectWithSomePrimitiveFields(com.sun.jdi.ObjectReference obj,
java.util.List<com.sun.jdi.Field> fs,
java.io.PrintWriter out) |
private static void |
labelStaticClassWithNoPrimitiveFields(com.sun.jdi.ReferenceType type,
java.io.PrintWriter out) |
private static void |
labelStaticClassWithSomePrimitiveFields(com.sun.jdi.ReferenceType type,
java.util.List<com.sun.jdi.Field> fs,
java.io.PrintWriter out) |
private static boolean |
looksLikePrimitiveArray(com.sun.jdi.ArrayReference obj) |
private static java.lang.String |
nextFilename() |
private static java.lang.String |
objectGvName(com.sun.jdi.ObjectReference obj) |
private static boolean |
objectHasPrimitives(java.util.List<com.sun.jdi.Field> fs,
com.sun.jdi.ObjectReference obj) |
private static java.lang.String |
objectName(com.sun.jdi.ObjectReference obj) |
static java.lang.String |
peekFilename()
The name of the output file is derived from
baseFilename by
appending successive integers. |
private static boolean |
processFrame(int frameNumber,
com.sun.jdi.StackFrame frame,
java.io.PrintWriter out,
java.util.Set<com.sun.jdi.ObjectReference> visited) |
private static void |
processObject(com.sun.jdi.ObjectReference obj,
java.io.PrintWriter out,
java.util.Set<com.sun.jdi.ObjectReference> visited) |
private static void |
processObjectArray(com.sun.jdi.ArrayReference obj,
java.io.PrintWriter out,
java.util.Set<com.sun.jdi.ObjectReference> visited) |
private static void |
processObjectWithLabel(java.lang.String label,
com.sun.jdi.ObjectReference obj,
java.io.PrintWriter out,
java.util.Set<com.sun.jdi.ObjectReference> visited) |
private static void |
processPrimitiveArray(com.sun.jdi.ArrayReference obj,
java.io.PrintWriter out) |
private static void |
processStaticClass(com.sun.jdi.ReferenceType type,
java.io.PrintWriter out,
java.util.Set<com.sun.jdi.ObjectReference> visited) |
private static boolean |
processValueInline(boolean showNull,
java.lang.String prefix,
com.sun.jdi.Value val,
java.io.PrintWriter out) |
private static void |
processValueStandalone(java.lang.String gvSource,
java.lang.String arrowAttributes,
java.lang.String fieldName,
com.sun.jdi.Value val,
java.io.PrintWriter out,
java.util.Set<com.sun.jdi.ObjectReference> visited) |
private static void |
processWrapperAsSimple(java.lang.String gvName,
com.sun.jdi.Value val,
java.io.PrintWriter out,
java.util.Set<com.sun.jdi.ObjectReference> visited) |
protected static java.lang.String |
quote(java.lang.String s) |
private static void |
setBaseFilename() |
static void |
setOutputDirectory(java.lang.String dirName,
java.lang.String mainClassName)
Graphics files are saved in directory dirName/mainClassName.
|
private static java.lang.String |
staticClassGvName(com.sun.jdi.ReferenceType type) |
private static boolean |
staticClassHasFields(java.util.List<com.sun.jdi.Field> fs) |
private static boolean |
staticClassHasPrimitives(java.util.List<com.sun.jdi.Field> fs,
com.sun.jdi.ReferenceType staticClass) |
private static java.lang.String |
staticClassName(com.sun.jdi.ReferenceType type) |
private static java.lang.String |
unescapeJavaString(java.lang.String st)
Unescapes a string that contains standard Java escape sequences.
|
private static com.sun.jdi.Value |
valueByFieldname(com.sun.jdi.ObjectReference obj,
java.lang.String fieldName) |
private static java.lang.String dirName
private static java.lang.String mainClassName
private static int nextGraphNumber
private static java.lang.String baseFilename
public static final java.util.HashMap<java.lang.String,java.lang.String> objectAttributeMap
public static final java.util.HashMap<java.lang.String,java.lang.String> staticClassAttributeMap
public static final java.util.HashMap<java.lang.String,java.lang.String> frameAttributeMap
public static final java.util.HashMap<java.lang.String,java.lang.String> fieldAttributeMap
private static final java.lang.String quotable
protected static final java.lang.String PREFIX_UNUSED_LABEL
private static final java.lang.String PREFIX_LABEL
private static final java.lang.String PREFIX_ARRAY
private static final java.lang.String PREFIX_OBJECT
private static final java.lang.String PREFIX_STATIC
private static final java.lang.String PREFIX_FRAME
private static final java.lang.String PREFIX_RETURN
private static final java.lang.String PREFIX_EXCEPTION
private Graphviz()
public static void setOutputDirectory(java.lang.String dirName, java.lang.String mainClassName)
public static java.lang.String peekFilename()
baseFilename
by
appending successive integers.private static java.lang.String nextFilename()
private static void setBaseFilename()
private static boolean canTreatAsPrimitive(com.sun.jdi.Value v)
private static boolean looksLikePrimitiveArray(com.sun.jdi.ArrayReference obj)
private static boolean canIgnoreObjectField(com.sun.jdi.Field field)
private static boolean canIgnoreStaticField(com.sun.jdi.Field field)
private static boolean canAppearUnquotedInLabel(char c)
protected static java.lang.String quote(java.lang.String s)
private static java.lang.String unescapeJavaString(java.lang.String st)
st
- A string optionally containing standard java escape sequences.private static void processPrimitiveArray(com.sun.jdi.ArrayReference obj, java.io.PrintWriter out)
private static void processObjectArray(com.sun.jdi.ArrayReference obj, java.io.PrintWriter out, java.util.Set<com.sun.jdi.ObjectReference> visited)
private static void processValueStandalone(java.lang.String gvSource, java.lang.String arrowAttributes, java.lang.String fieldName, com.sun.jdi.Value val, java.io.PrintWriter out, java.util.Set<com.sun.jdi.ObjectReference> visited)
private static boolean processValueInline(boolean showNull, java.lang.String prefix, com.sun.jdi.Value val, java.io.PrintWriter out)
private static void processWrapperAsSimple(java.lang.String gvName, com.sun.jdi.Value val, java.io.PrintWriter out, java.util.Set<com.sun.jdi.ObjectReference> visited)
private static java.lang.String objectName(com.sun.jdi.ObjectReference obj)
private static java.lang.String objectGvName(com.sun.jdi.ObjectReference obj)
private static boolean objectHasPrimitives(java.util.List<com.sun.jdi.Field> fs, com.sun.jdi.ObjectReference obj)
private static void labelObjectWithNoPrimitiveFields(com.sun.jdi.ObjectReference obj, java.io.PrintWriter out)
private static void labelObjectWithSomePrimitiveFields(com.sun.jdi.ObjectReference obj, java.util.List<com.sun.jdi.Field> fs, java.io.PrintWriter out)
private static void processObjectWithLabel(java.lang.String label, com.sun.jdi.ObjectReference obj, java.io.PrintWriter out, java.util.Set<com.sun.jdi.ObjectReference> visited)
private static com.sun.jdi.Value valueByFieldname(com.sun.jdi.ObjectReference obj, java.lang.String fieldName)
private static void processObject(com.sun.jdi.ObjectReference obj, java.io.PrintWriter out, java.util.Set<com.sun.jdi.ObjectReference> visited)
private static java.lang.String staticClassName(com.sun.jdi.ReferenceType type)
private static java.lang.String staticClassGvName(com.sun.jdi.ReferenceType type)
private static boolean staticClassHasFields(java.util.List<com.sun.jdi.Field> fs)
private static boolean staticClassHasPrimitives(java.util.List<com.sun.jdi.Field> fs, com.sun.jdi.ReferenceType staticClass)
private static void labelStaticClassWithNoPrimitiveFields(com.sun.jdi.ReferenceType type, java.io.PrintWriter out)
private static void labelStaticClassWithSomePrimitiveFields(com.sun.jdi.ReferenceType type, java.util.List<com.sun.jdi.Field> fs, java.io.PrintWriter out)
private static void processStaticClass(com.sun.jdi.ReferenceType type, java.io.PrintWriter out, java.util.Set<com.sun.jdi.ObjectReference> visited)
private static java.lang.String frameName(int frameNumber, com.sun.jdi.StackFrame frame, com.sun.jdi.Method method, int lineNumber)
private static java.lang.String frameGvName(int frameNumber)
private static boolean frameHasPrimitives(java.util.Map<com.sun.jdi.LocalVariable,com.sun.jdi.Value> ls)
private static void labelFrameWithNoPrimitiveLocals(int frameNumber, com.sun.jdi.StackFrame frame, java.io.PrintWriter out)
private static void labelFrameWithSomePrimitiveLocals(int frameNumber, com.sun.jdi.StackFrame frame, java.util.Map<com.sun.jdi.LocalVariable,com.sun.jdi.Value> ls, java.io.PrintWriter out)
private static boolean processFrame(int frameNumber, com.sun.jdi.StackFrame frame, java.io.PrintWriter out, java.util.Set<com.sun.jdi.ObjectReference> visited)
public static void drawFramesCheck(java.lang.String loc, com.sun.jdi.Value returnVal, com.sun.jdi.Value exnVal, java.util.List<com.sun.jdi.StackFrame> frames, java.util.Set<com.sun.jdi.ReferenceType> staticClasses)
public static void drawFrames(int start, java.lang.String loc, com.sun.jdi.Value returnVal, com.sun.jdi.Value exnVal, java.util.List<com.sun.jdi.StackFrame> frames, java.util.Set<com.sun.jdi.ReferenceType> staticClasses)
public static void drawObjects(java.lang.String loc, java.util.Map<java.lang.String,com.sun.jdi.ObjectReference> objects)
protected static void drawStuff(java.lang.String loc, java.util.function.Consumer<java.io.PrintWriter> consumer)