Top Description Fields Constructors Methods
org.codehaus.groovy.runtime.powerassert

public final Class AssertionRenderer

extends Object
Class Inheritance
Imports
org.codehaus.groovy.runtime.InvokerHelper, java.util.ArrayList, .List

Creates a string representation of an assertion and its recorded values.

Field Summary

Modifier and TypeField and Description
private final List<StringBuilder>
private final ValueRecorder
private final List<Integer>
private final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static boolean
private static String
private String
private static void
placeString(StringBuilder line, String str, int column)

public static String

Returns:

a string representation of the assertion and its recorded values
render
(String
the assertion's source text
text
,
ValueRecorder
a recorder holding the values recorded during evaluation of the assertion
recorder
)

Creates a string representation of an assertion and its recorded values.

private String
private void
private void
private void
private static String

Returns:

a string representation of the given value
valueToString
(Object
a value
value
)

Returns a string representation of the given value, or null if the value should not be included (because it does not add any valuable information).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

linesback to summary
private final List<StringBuilder> lines
recorderback to summary
private final ValueRecorder recorder
startColumnsback to summary
private final List<Integer> startColumns
textback to summary
private final String text

Constructor Detail

AssertionRendererback to summary
private AssertionRenderer(String text, ValueRecorder recorder)

Method Detail

hasStringLikeTypeback to summary
private static boolean hasStringLikeType(Object value)
javaLangObjectToStringback to summary
private static String javaLangObjectToString(Object value)
linesToStringback to summary
private String linesToString()
placeStringback to summary
private static void placeString(StringBuilder line, String str, int column)
renderback to summary
public static String render(String text, ValueRecorder recorder)

Creates a string representation of an assertion and its recorded values.

Parameters
text:String

the assertion's source text

recorder:ValueRecorder

a recorder holding the values recorded during evaluation of the assertion

Returns:String

a string representation of the assertion and its recorded values

renderback to summary
private String render()
renderTextback to summary
private void renderText()
renderValuesback to summary
private void renderValues()
sortValuesback to summary
private void sortValues()
valueToStringback to summary
private static String valueToString(Object value)

Returns a string representation of the given value, or null if the value should not be included (because it does not add any valuable information).

Parameters
value:Object

a value

Returns:String

a string representation of the given value