de.danielbechler.diff.visitor
Class ToMapPrintingVisitor

java.lang.Object
  extended by de.danielbechler.diff.visitor.PrintingVisitor
      extended by de.danielbechler.diff.visitor.ToMapPrintingVisitor
All Implemented Interfaces:
Node.Visitor

public class ToMapPrintingVisitor
extends PrintingVisitor

This visitor generates the same output as the 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.

Author:
Daniel Bechler (SQiShER), Mayank Kumar (mayankk)

Constructor Summary
ToMapPrintingVisitor(Object working, Object base)
           
 
Method Summary
 void clear()
           
protected  String differenceToString(Node node, Object base, Object modified)
           
 String getMessage(PropertyPath path)
           
 Map<PropertyPath,String> getMessages()
           
 String getMessagesAsString()
           
 boolean hasMessages()
           
protected  void print(String text)
           
 String toString()
           
 
Methods inherited from class de.danielbechler.diff.visitor.PrintingVisitor
accept, filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToMapPrintingVisitor

public ToMapPrintingVisitor(Object working,
                            Object base)
Method Detail

print

protected void print(String text)
Overrides:
print in class PrintingVisitor

differenceToString

protected String differenceToString(Node node,
                                    Object base,
                                    Object modified)
Overrides:
differenceToString in class PrintingVisitor

clear

public void clear()

getMessages

public Map<PropertyPath,String> getMessages()

getMessage

public String getMessage(PropertyPath path)

hasMessages

public boolean hasMessages()

getMessagesAsString

public String getMessagesAsString()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.