@Override
protected void doProcess(
final ITemplateContext context,
final IProcessableElementTag tag,
final AttributeName attributeName, final String attributeValue,
final Object expressionResult,
final IElementTagStructureHandler structureHandler) {
if (expressionResult != null) {
final String resultStr = expressionResult.toString();
if (VALUE_ALL.equalsIgnoreCase(resultStr)) {
structureHandler.removeElement();
} else if (VALUE_TAG.equalsIgnoreCase(resultStr) || VALUE_TAGS.equalsIgnoreCase(resultStr)) {
structureHandler.removeTags();
} else if (VALUE_ALL_BUT_FIRST.equalsIgnoreCase(resultStr)) {
structureHandler.removeAllButFirstChild();
} else if (VALUE_BODY.equalsIgnoreCase(resultStr)) {
structureHandler.removeBody();
} else if (!VALUE_NONE.equalsIgnoreCase(resultStr)) {
throw new TemplateProcessingException(
"Invalid value specified for \"" + attributeName + "\": only 'all', 'tag', 'body', 'none' " +
"and 'all-but-first' are allowed, but \"" + attributeValue + "\" was specified.");
}
}
}