use of com.enonic.xp.portal.impl.parser.Instruction in project xp by enonic.
the class PostProcessEvaluator method processInstructions.
private HtmlBlocks processInstructions(final HtmlBlocks htmlBlocks) {
final HtmlBlocks.Builder processedHtmlBlocks = HtmlBlocks.builder();
for (HtmlBlock htmlBlock : htmlBlocks) {
if (isInstruction(htmlBlock)) {
final String instructionContent = ((Instruction) htmlBlock).getValue();
final HtmlBlocks processedInstruction = executeInstruction(instructionContent);
if (processedInstruction != null) {
processedHtmlBlocks.addAll(processedInstruction);
}
} else {
processedHtmlBlocks.add(htmlBlock);
}
}
return processedHtmlBlocks.build();
}
Aggregations