org.test4j.hamcrest.matcher.property.report
类 DefaultDifferenceView

java.lang.Object
  继承者 org.test4j.hamcrest.matcher.property.report.DefaultDifferenceView
所有已实现的接口:
DifferenceView

public class DefaultDifferenceView
extends Object
implements DifferenceView

Formatter that will output all leaf differences in the tree and, in case of an unordered collection difference, the difference of all best matches.


嵌套类摘要
protected  class DefaultDifferenceView.DifferenceFormatterVisitor
          The visitor for visiting the difference tree.
 
字段摘要
protected  DefaultDifferenceView.DifferenceFormatterVisitor differenceFormatterVisitor
          The visitor for visiting the difference tree
protected  ObjectFormatter objectFormatter
          Formatter for object values.
protected  boolean outputtingUnorderedCollectionDifference
          True when an unordered collection is being formatted.
 
构造方法摘要
DefaultDifferenceView()
           
 
方法摘要
protected  String createFieldName(String fieldName, String innerFieldName, boolean includePoint)
          Adds the inner field name to the given field name.
 String createView(Difference difference)
          Creates a string representation of the given difference tree.
protected  String formatDifference(CollectionDifference collectionDifference, String fieldName)
          Creates a string representation of a collection difference.
protected  String formatDifference(Difference difference, String fieldName)
          Creates a string representation of a simple difference.
protected  String formatDifference(MapDifference mapDifference, String fieldName)
          Creates a string representation of a map difference.
protected  String formatDifference(ObjectDifference objectDifference, String fieldName)
          Creates a string representation of an object difference.
protected  String formatDifference(UnorderedCollectionDifference unorderedCollectionDifference, String fieldName)
          Creates a string representation of an unordered collection difference.
protected  String formatDifferrence(ClassDifference classDifference, String fieldName)
           
protected  String formatObject(Object object)
           
protected  String formatValues(String fieldName, Object leftValue, Object rightValue)
          Formats and appends the given fieldname and object values.
protected  String formatValuesOnMultipleLines(String fieldName, String leftValueFormatted, String rightValueFormatted)
           
protected  String formatValuesOnOneLine(String fieldName, String leftValueFormatted, String rightValueFormatted)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

outputtingUnorderedCollectionDifference

protected boolean outputtingUnorderedCollectionDifference
True when an unordered collection is being formatted.


objectFormatter

protected ObjectFormatter objectFormatter
Formatter for object values.


differenceFormatterVisitor

protected DefaultDifferenceView.DifferenceFormatterVisitor differenceFormatterVisitor
The visitor for visiting the difference tree

构造方法详细信息

DefaultDifferenceView

public DefaultDifferenceView()
方法详细信息

createView

public String createView(Difference difference)
Creates a string representation of the given difference tree.

指定者:
接口 DifferenceView 中的 createView
参数:
difference - The root difference, not null
返回:
The string representation, not null

formatDifference

protected String formatDifference(Difference difference,
                                  String fieldName)
Creates a string representation of a simple difference.

参数:
difference - The difference, not null
fieldName - The current fieldName, null for root
返回:
The string representation, not null

formatDifference

protected String formatDifference(ObjectDifference objectDifference,
                                  String fieldName)
Creates a string representation of an object difference.

参数:
objectDifference - The difference, not null
fieldName - The current fieldName, null for root
返回:
The string representation, not null

formatDifferrence

protected String formatDifferrence(ClassDifference classDifference,
                                   String fieldName)

formatDifference

protected String formatDifference(CollectionDifference collectionDifference,
                                  String fieldName)
Creates a string representation of a collection difference.

参数:
collectionDifference - The difference, not null
fieldName - The current fieldName, null for root
返回:
The string representation, not null

formatDifference

protected String formatDifference(MapDifference mapDifference,
                                  String fieldName)
Creates a string representation of a map difference.

参数:
mapDifference - The difference, not null
fieldName - The current fieldName, null for root
返回:
The string representation, not null

formatObject

protected String formatObject(Object object)

formatDifference

protected String formatDifference(UnorderedCollectionDifference unorderedCollectionDifference,
                                  String fieldName)
Creates a string representation of an unordered collection difference.

参数:
unorderedCollectionDifference - The difference, not null
fieldName - The current fieldName, null for root
返回:
The string representation, not null

formatValues

protected String formatValues(String fieldName,
                              Object leftValue,
                              Object rightValue)
Formats and appends the given fieldname and object values.

参数:
fieldName - The field name, null if there is no field name
leftValue - The left value
rightValue - The right value
返回:
The string representation, not null

formatValuesOnOneLine

protected String formatValuesOnOneLine(String fieldName,
                                       String leftValueFormatted,
                                       String rightValueFormatted)

formatValuesOnMultipleLines

protected String formatValuesOnMultipleLines(String fieldName,
                                             String leftValueFormatted,
                                             String rightValueFormatted)

createFieldName

protected String createFieldName(String fieldName,
                                 String innerFieldName,
                                 boolean includePoint)
Adds the inner field name to the given field name.

参数:
fieldName - The field
innerFieldName - The field to append, not null
includePoint - True if a point should be added
返回:
The field name


Copyright © 2013. All rights reserved.