if (jsonhelper.isJsonValid(item.getAdditionalStrings()[i])) {
item.getAdditionalStrings()[i] =
getTemplateForItem(new JsonDocItem(item.getAdditionalStrings()[i]));
} else {
item.getAdditionalStrings()[i] =
getTemplateForItem(new HighlightedTextDocItem(
item.getAdditionalStrings()[i]));
}
}
item.setText(String.format(item.getText(), (Object[]) item.getAdditionalStrings()));