public class SlimFormatter extends Object implements CellFormatter<String>
| Constructor and Description |
|---|
SlimFormatter() |
| Modifier and Type | Method and Description |
|---|---|
void |
asLink(CellWrapper<String> cell,
String resolvedUrl,
String link,
String text)
formats the content as a hyperlink.
|
void |
check(CellWrapper<String> expected,
RestDataTypeAdapter actual)
formats a check cell.
|
void |
exception(CellWrapper<String> cell,
String exceptionMessage)
formats a cell containing an exception.
|
void |
exception(CellWrapper<String> cell,
Throwable exception)
formats a cell containing an exception.
|
String |
fromRaw(String text)
in SLIM cell content is HTML escaped - we abstract this method to
delegate to formatter the cleaning of the content.
|
String |
gray(String string)
formats a cell with a gray background.
|
boolean |
isDisplayActual() |
String |
label(String string)
formats a cell label
|
void |
right(CellWrapper<String> expected,
RestDataTypeAdapter typeAdapter)
formats a cell representing a right expectation.
|
void |
setDisplayAbsoluteURLInFull(boolean displayAbsoluteURLInFull)
sets whether absolute urls are displayed in full
|
void |
setDisplayActual(boolean d)
sets whether the cell should display the actual value after evaluation.
|
void |
setMinLengthForToggleCollapse(int minLen)
renders the cell as a toggle area if the content of the cell is over the
min value set here.
|
void |
wrong(CellWrapper<String> expected,
RestDataTypeAdapter ta)
formats a cell representing a wrong expectation.
|
public void setDisplayActual(boolean d)
CellFormattersetDisplayActual in interface CellFormatter<String>d - true if actual value has to be rendered.public void setDisplayAbsoluteURLInFull(boolean displayAbsoluteURLInFull)
CellFormattersetDisplayAbsoluteURLInFull in interface CellFormatter<String>displayAbsoluteURLInFull - the value to setpublic void setMinLengthForToggleCollapse(int minLen)
CellFormattersetMinLengthForToggleCollapse in interface CellFormatter<String>minLen - the min value of the content of a cell.public boolean isDisplayActual()
isDisplayActual in interface CellFormatter<String>public void exception(CellWrapper<String> cell, String exceptionMessage)
CellFormatterexception in interface CellFormatter<String>cell - the cell wrapperexceptionMessage - the exception message to render.public void exception(CellWrapper<String> cell, Throwable exception)
CellFormatterexception in interface CellFormatter<String>cell - the cell wrapperexception - the excteption to render.public void check(CellWrapper<String> expected, RestDataTypeAdapter actual)
CellFormattercheck in interface CellFormatter<String>expected - the cell value.actual - the adapter interpreting the value.public String label(String string)
CellFormatterlabel in interface CellFormatter<String>string - the labelpublic void wrong(CellWrapper<String> expected, RestDataTypeAdapter ta)
CellFormatterwrong in interface CellFormatter<String>expected - the expected valueta - the adapter with the actual value.public void right(CellWrapper<String> expected, RestDataTypeAdapter typeAdapter)
CellFormatterright in interface CellFormatter<String>expected - the expected valuetypeAdapter - the adapter with the actual value.public String gray(String string)
CellFormattergray in interface CellFormatter<String>string - the contentpublic void asLink(CellWrapper<String> cell, String resolvedUrl, String link, String text)
CellFormatterasLink in interface CellFormatter<String>cell - the cell.resolvedUrl - the cell content after symbols' substitution.link - the uri in the href.text - the text.public String fromRaw(String text)
CellFormatterfromRaw in interface CellFormatter<String>text - the textCopyright © 2017 smartrics. All rights reserved.