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)
| 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 | } |