public class ToMapPrintingVisitor extends PrintingVisitor
PrintingVisitor
, but instead of printing it to
System.out
, it will store the messages in a Map, identified by the property path of the
visited node. The Map
can later be accessed via getMessages()
to provide a way to
post-process the collected information.Constructor and Description |
---|
ToMapPrintingVisitor(java.lang.Object working,
java.lang.Object base) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
protected java.lang.String |
differenceToString(DiffNode node,
java.lang.Object base,
java.lang.Object modified) |
java.lang.String |
getMessage(NodePath path) |
java.util.Map<NodePath,java.lang.String> |
getMessages() |
java.lang.String |
getMessagesAsString() |
boolean |
hasMessages() |
protected void |
print(java.lang.String text) |
java.lang.String |
toString() |
filter, node
public ToMapPrintingVisitor(java.lang.Object working, java.lang.Object base)
protected void print(java.lang.String text)
print
in class PrintingVisitor
protected java.lang.String differenceToString(DiffNode node, java.lang.Object base, java.lang.Object modified)
differenceToString
in class PrintingVisitor
public void clear()
public java.util.Map<NodePath,java.lang.String> getMessages()
public java.lang.String getMessage(NodePath path)
public boolean hasMessages()
public java.lang.String getMessagesAsString()
public java.lang.String toString()
toString
in class java.lang.Object