MCPcopy Create free account
hub / github.com/PCGen/pcgen / toHtmlString

Method toHtmlString

code/src/java/pcgen/core/prereq/PrereqHandler.java:266–299  ·  view source on GitHub ↗

Generates an HTML representation of a list of PreRequisite objects. @param anArrayList the list of PreRequisite objects to be represented. @return An HTML representation of the input.

(final Collection<Prerequisite> anArrayList)

Source from the content-addressed store, hash-verified

264 * @return An HTML representation of the input.
265 */
266 public static String toHtmlString(final Collection<Prerequisite> anArrayList)
267 {
268 if (anArrayList == null || anArrayList.isEmpty())
269 {
270 return Constants.EMPTY_STRING;
271 }
272
273 final PrerequisiteTestFactory factory = PrerequisiteTestFactory.getInstance();
274
275 final StringBuilder pString = new StringBuilder(anArrayList.size() * 20);
276
277 String delimiter = Constants.EMPTY_STRING;
278
279 for (Prerequisite preReq : anArrayList)
280 {
281 final PrerequisiteTest preReqTest = factory.getTest(preReq.getKind());
282
283 if (preReqTest == null)
284 {
285 final String message = "PrereqHandler.No_known_formatter"; //$NON-NLS-1$
286 Logging.errorPrintLocalised(message, preReq.getKind());
287 }
288 else
289 {
290 pString.append(delimiter);
291 pString.append(preReqTest.toHtmlString(preReq));
292
293 final String property = "PrereqHandler.HTML_prerequisite_delimiter"; //$NON-NLS-1$
294 delimiter = LanguageBundle.getString(property);
295 }
296 }
297
298 return pString.toString();
299 }
300
301}

Callers 3

testToHtmlMethod · 0.95
testApplyMethod · 0.95

Calls 10

getInstanceMethod · 0.95
getTestMethod · 0.95
errorPrintLocalisedMethod · 0.95
toHtmlStringMethod · 0.95
getStringMethod · 0.95
getKindMethod · 0.80
isEmptyMethod · 0.65
sizeMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45

Tested by 1

testToHtmlMethod · 0.76