public class HtmlRenderingSupportImpl extends Object implements HtmlRenderingSupport
| Constructor and Description |
|---|
HtmlRenderingSupportImpl() |
HtmlRenderingSupportImpl(Format format,
boolean filter) |
| Modifier and Type | Method and Description |
|---|---|
static String |
blankNonAlpha(String input)
Replace all non-alhphanumeric characters by a blank "_".
|
String |
capitalize(String s) |
Map<String,Number> |
collectColumnValues(List<Column> columns,
HasMetrics info) |
int |
constrain(float input,
int min,
int max)
Returns a value a given percentage amount between min and max.
|
int |
contains(Set set,
int key) |
String |
format1d(float pc) |
String |
format2d(double aVal) |
String |
format3d(double aVal) |
String |
formatInt(int aVal) |
String |
formatMultiply1d(float pc,
float multiplier) |
String |
formatMultiply1dReverse(float pc,
float multiplier,
float max) |
String |
formatShortDate(long ts) |
String |
getBaseFileName(BaseClassInfo classInfo) |
String |
getColor(StatisticsClassInfoVisitor stats,
BaseClassInfo classInfo) |
String |
getFileIdentifier(FullFileInfo aFile) |
StringBuffer |
getFileLink(boolean toplevel,
BaseFileInfo fileInfo) |
int |
getFontSize(StatisticsClassInfoVisitor stats,
BaseClassInfo classInfo,
int min,
int max) |
float |
getFraction(float num,
long dem) |
String |
getMethodIndentiation(MethodInfo methodInfo) |
String |
getMethodLink(boolean toplevel,
FullMethodInfo mthd) |
String |
getPackageRelPath(String pkgA,
String pkgB) |
static String |
getPcWidth(float pc) |
static String |
getPcWidth(Float pc) |
String |
getPercentStr(float aPc) |
String |
getPkgURLPath(String aPkg) |
String |
getPkgURLPath(String aPkg,
String aFile) |
static int |
getRemainder(int w,
float aPc) |
String |
getRemainderPcWidth(float pc) |
String |
getRemainderPercentStr(float aPc) |
String |
getRootRelPath(String aPkg) |
StringBuffer |
getSrcFileLink(boolean toplevel,
BaseClassInfo cls,
long idParam) |
StringBuffer |
getSrcFileLink(boolean toplevel,
boolean withAnchor,
BaseClassInfo cls,
BasePackageInfo pkgInContext) |
StringBuffer |
getSrcFileLink(boolean toplevel,
boolean withAnchor,
ClassInfo cls)
Get a link to a source file for a given class, e.g.
|
StringBuffer |
getSrcFileLink(boolean isTopLevel,
boolean withAnchor,
String className,
String containingFileName,
String packageName) |
String |
getSrcLineLink(boolean toplevel,
FileInfo file,
int line) |
String |
getTestClassLink(boolean topLevel,
ClassInfo classInfo) |
StringBuffer |
getTestFileName(TestCaseInfo testInfo) |
StringBuffer |
getTestLink(boolean topLevel,
TestCaseInfo testInfo) |
static int |
getWidth(int w,
float aPc) |
String |
getWrappablePath(String aStr) |
String |
htmlEscapeStr(String aString) |
String |
htmlEscapeStr(String aString,
String tabString,
String spaceString) |
static String |
isAre(int value) |
String |
javaScriptEscapeStr(String input) |
String |
joinWithDots(String s1,
String s2)
Join two strings.
|
int |
length(Object[] array) |
String |
linkifyStackTrace(String rootRelPath,
FullProjectInfo proj,
String trace)
renders a stack trace by inserting hyperlinking for class/filenames where found.
|
String |
linkifyStackTrace(String rootRelPath,
StackTraceInfo trace) |
void |
listAddKeyAsLast(ArrayList<String> list,
String key)
Check if obj in an ArrayList, get last element, contatenate with a key and add to the end of the list.
|
String |
listGetLast(ArrayList<String> list)
ArrayList does not have getLast() method; and we need it in one velocity template.
|
void |
listRemoveLast(ArrayList list)
ArrayList does not have removeLast() method; and we need it in one velocity template.
|
BlockMetrics |
metricsFor(HasMetrics info) |
static String |
pluralize(int value,
String word) |
Set<TestCaseInfo> |
tcisInHitRange(Map<TestCaseInfo,BitSet> tcisAndHits,
CoverageDataRange range)
Helper method used because Velocity doesn't support static method invocations
|
String |
truncateEnd(String str) |
String |
truncateEnd(String str,
int length) |
String |
truncateStart(String str) |
public HtmlRenderingSupportImpl()
public HtmlRenderingSupportImpl(Format format, boolean filter)
public Map<String,Number> collectColumnValues(List<Column> columns, HasMetrics info) throws CloverException
CloverExceptionpublic BlockMetrics metricsFor(HasMetrics info)
public String formatShortDate(long ts)
public String getPercentStr(float aPc)
public String getRemainderPercentStr(float aPc)
public String getFileIdentifier(FullFileInfo aFile)
public String getRootRelPath(String aPkg)
getRootRelPath in interface HtmlRenderingSupportpublic String getPackageRelPath(String pkgA, String pkgB)
getPackageRelPath in interface HtmlRenderingSupportpublic StringBuffer getTestFileName(TestCaseInfo testInfo)
public StringBuffer getTestLink(boolean topLevel, TestCaseInfo testInfo)
public StringBuffer getSrcFileLink(boolean toplevel, BaseClassInfo cls, long idParam)
public StringBuffer getFileLink(boolean toplevel, BaseFileInfo fileInfo)
public StringBuffer getSrcFileLink(boolean toplevel, boolean withAnchor, BaseClassInfo cls, BasePackageInfo pkgInContext)
public StringBuffer getSrcFileLink(boolean toplevel, boolean withAnchor, ClassInfo cls)
HtmlRenderingSupportgetSrcFileLink in interface HtmlRenderingSupporttoplevel - whether we need a link to a file from a top level (will contain package path) or not (will have
a link to file only)withAnchor - whether link should contain an anchor to the clascls - class we want a link forpublic String getMethodLink(boolean toplevel, FullMethodInfo mthd)
public StringBuffer getSrcFileLink(boolean isTopLevel, boolean withAnchor, String className, String containingFileName, String packageName)
public String getMethodIndentiation(MethodInfo methodInfo)
public String getBaseFileName(BaseClassInfo classInfo)
public static int getWidth(int w,
float aPc)
public static int getRemainder(int w,
float aPc)
public static String getPcWidth(float pc)
public String getRemainderPcWidth(float pc)
public String format1d(float pc)
public String formatMultiply1d(float pc, float multiplier)
public String formatMultiply1dReverse(float pc, float multiplier, float max)
public String formatInt(int aVal)
public String format2d(double aVal)
public String format3d(double aVal)
public String joinWithDots(String s1, String s2)
public void listAddKeyAsLast(@NotNull
ArrayList<String> list,
@NotNull
String key)
@Nullable public String listGetLast(@NotNull ArrayList<String> list)
public void listRemoveLast(@NotNull
ArrayList list)
public int contains(Set set, int key)
public int length(Object[] array)
public String htmlEscapeStr(String aString, String tabString, String spaceString)
htmlEscapeStr in interface HtmlRenderingSupportpublic String linkifyStackTrace(String rootRelPath, FullProjectInfo proj, String trace)
public String linkifyStackTrace(String rootRelPath, StackTraceInfo trace)
public int constrain(float input,
int min,
int max)
public int getFontSize(StatisticsClassInfoVisitor stats, BaseClassInfo classInfo, int min, int max)
public String getColor(StatisticsClassInfoVisitor stats, BaseClassInfo classInfo)
public float getFraction(float num,
long dem)
public Set<TestCaseInfo> tcisInHitRange(Map<TestCaseInfo,BitSet> tcisAndHits, CoverageDataRange range)
public static String blankNonAlpha(String input)
public static String isAre(int value)
Copyright © 2024 OpenClover.org. All rights reserved.