Package stdlib
Class Graphviz
java.lang.Object
stdlib.Graphviz
-
Field Summary
Modifier and TypeFieldDescriptionprivate static String
private static String
private static String
private static int
private static int
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
protected static final String
private static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addNullDot
(String gvSource, String label, String arrowAttributes, PrintWriter out) private static boolean
canAppearUnquotedInLabel
(char c) private static boolean
canIgnoreObjectField
(Field field) private static boolean
canIgnoreStaticField
(Field field) private static boolean
static void
drawFrames
(int start, int len, String loc, Value returnVal, Value exnVal, List<StackFrame> frames, Set<ReferenceType> staticClasses, boolean overrideShowStatics) static void
drawFramesCheck
(String loc, Value returnVal, Value exnVal, List<StackFrame> frames, Set<ReferenceType> staticClasses) static void
drawObjects
(String loc, Map<String, ObjectReference> objects) protected static void
drawStuff
(String loc, Consumer<PrintWriter> consumer) private static String
frameGvName
(int frameNumber) private static boolean
private static String
frameName
(int frameNumber, StackFrame frame, Method method, int lineNumber) static String
private static boolean
private static boolean
static boolean
private static void
labelFrameWithNoPrimitiveLocals
(int frameNumber, StackFrame frame, PrintWriter out) private static void
labelFrameWithSomePrimitiveLocals
(int frameNumber, StackFrame frame, Map<LocalVariable, Value> ls, PrintWriter out) private static void
labelNodeWithSomePrimitiveFields
(ObjectReference obj, List<Field> fs, PrintWriter out) private static void
private static void
labelObjectWithSomePrimitiveFields
(ObjectReference obj, List<Field> fs, PrintWriter out) private static void
private static void
labelStaticClassWithSomePrimitiveFields
(ReferenceType type, List<Field> fs, PrintWriter out) private static boolean
private static String
private static String
private static boolean
objectHasNonNodeReferences
(List<Field> fs, ObjectReference obj) private static boolean
objectHasPrimitives
(List<Field> fs, ObjectReference obj) private static String
private static String
objectNameOnly
(Value val) static String
The name of the output file is derived frombaseFilename
by appending successive integers.private static boolean
processFrame
(int frameNumber, StackFrame frame, PrintWriter out, Set<ObjectReference> visited) private static void
processNodeStandalone
(boolean srcIsNode, boolean srcHasNonNodeReferences, String gvSource, String fieldName, Value val, PrintWriter out, Set<ObjectReference> visited) private static void
processObject
(ObjectReference obj, PrintWriter out, Set<ObjectReference> visited) private static void
processObjectArray
(ArrayReference obj, PrintWriter out, Set<ObjectReference> visited) private static void
processObjectWithLabel
(String label, ObjectReference obj, PrintWriter out, Set<ObjectReference> visited) private static void
processPrimitiveArray
(ArrayReference obj, PrintWriter out) private static void
processStaticClass
(ReferenceType type, PrintWriter out, Set<ObjectReference> visited) private static boolean
processValueInline
(boolean showNull, String prefix, Value val, PrintWriter out) private static void
processValueStandalone
(String gvSource, String arrowAttributes, String fieldName, Value val, PrintWriter out, Set<ObjectReference> visited) private static void
processWrapperAsSimple
(String gvName, Value val, PrintWriter out, Set<ObjectReference> visited) protected static String
private static void
static void
setOutputDirectory
(String dirName, String mainClassName) Graphics files are saved in directory dirName/mainClassName.private static String
private static boolean
private static boolean
staticClassHasPrimitives
(List<Field> fs, ReferenceType staticClass) private static String
staticClassName
(ReferenceType type) private static String
Unescapes a string that contains standard Java escape sequences.private static Value
valueByFieldname
(ObjectReference obj, String fieldName)
-
Field Details
-
dirName
-
mainClassName
-
nextGraphNumber
-
baseFilename
-
objectAttributeMap
-
staticClassAttributeMap
-
frameAttributeMap
-
fieldAttributeMap
-
quotable
- See Also:
-
PREFIX_UNUSED_LABEL
- See Also:
-
PREFIX_LABEL
- See Also:
-
PREFIX_ARRAY
- See Also:
-
PREFIX_OBJECT
- See Also:
-
PREFIX_STATIC
- See Also:
-
PREFIX_FRAME
- See Also:
-
PREFIX_RETURN
- See Also:
-
PREFIX_EXCEPTION
- See Also:
-
nullId
-
-
Constructor Details
-
Graphviz
private Graphviz()
-
-
Method Details
-
setOutputDirectory
Graphics files are saved in directory dirName/mainClassName. dirName directory is created if it does not already exist. If dirName/mainClassName exists, then numbers are appended to the directory name: "dirName/mainClassName 1", "dirName/mainClassName 2", etc. -
isWindows
-
getDesktop
-
peekFilename
The name of the output file is derived frombaseFilename
by appending successive integers. -
nextFilename
-
setBaseFilename
-
canTreatAsPrimitive
-
looksLikePrimitiveArray
-
canIgnoreObjectField
-
canIgnoreStaticField
-
canAppearUnquotedInLabel
-
quote
-
unescapeJavaString
Unescapes a string that contains standard Java escape sequences.- \\b \\f \\n \\r \\t \\" \\' : BS, FF, NL, CR, TAB, double and single quote.
- \\N \\NN \\NNN : Octal character specification (0 - 377, 0x00 - 0xFF).
- \\uNNNN : Hexadecimal based Unicode character.
- Parameters:
st
- A string optionally containing standard java escape sequences.- Returns:
- The translated string.
-
processPrimitiveArray
-
processObjectArray
private static void processObjectArray(ArrayReference obj, PrintWriter out, Set<ObjectReference> visited) -
processValueStandalone
private static void processValueStandalone(String gvSource, String arrowAttributes, String fieldName, Value val, PrintWriter out, Set<ObjectReference> visited) -
processValueInline
private static boolean processValueInline(boolean showNull, String prefix, Value val, PrintWriter out) -
processWrapperAsSimple
private static void processWrapperAsSimple(String gvName, Value val, PrintWriter out, Set<ObjectReference> visited) -
objectNameOnly
-
objectName
-
objectGvName
-
objectHasPrimitives
-
objectHasNonNodeReferences
-
labelObjectWithNoPrimitiveFields
-
labelObjectWithSomePrimitiveFields
private static void labelObjectWithSomePrimitiveFields(ObjectReference obj, List<Field> fs, PrintWriter out) -
labelNodeWithSomePrimitiveFields
private static void labelNodeWithSomePrimitiveFields(ObjectReference obj, List<Field> fs, PrintWriter out) -
processNodeStandalone
private static void processNodeStandalone(boolean srcIsNode, boolean srcHasNonNodeReferences, String gvSource, String fieldName, Value val, PrintWriter out, Set<ObjectReference> visited) -
addNullDot
private static void addNullDot(String gvSource, String label, String arrowAttributes, PrintWriter out) -
processObjectWithLabel
private static void processObjectWithLabel(String label, ObjectReference obj, PrintWriter out, Set<ObjectReference> visited) -
valueByFieldname
-
isNode
-
isNode
-
processObject
private static void processObject(ObjectReference obj, PrintWriter out, Set<ObjectReference> visited) -
staticClassName
-
staticClassGvName
-
staticClassHasFields
-
staticClassHasPrimitives
-
labelStaticClassWithNoPrimitiveFields
-
labelStaticClassWithSomePrimitiveFields
private static void labelStaticClassWithSomePrimitiveFields(ReferenceType type, List<Field> fs, PrintWriter out) -
processStaticClass
private static void processStaticClass(ReferenceType type, PrintWriter out, Set<ObjectReference> visited) -
frameName
-
frameGvName
-
frameHasPrimitives
-
labelFrameWithNoPrimitiveLocals
private static void labelFrameWithNoPrimitiveLocals(int frameNumber, StackFrame frame, PrintWriter out) -
labelFrameWithSomePrimitiveLocals
private static void labelFrameWithSomePrimitiveLocals(int frameNumber, StackFrame frame, Map<LocalVariable, Value> ls, PrintWriter out) -
processFrame
private static boolean processFrame(int frameNumber, StackFrame frame, PrintWriter out, Set<ObjectReference> visited) -
drawFramesCheck
public static void drawFramesCheck(String loc, Value returnVal, Value exnVal, List<StackFrame> frames, Set<ReferenceType> staticClasses) -
drawFrames
public static void drawFrames(int start, int len, String loc, Value returnVal, Value exnVal, List<StackFrame> frames, Set<ReferenceType> staticClasses, boolean overrideShowStatics) -
drawObjects
-
drawStuff
-