Java Code Examples for org.apache.velocity.runtime.directive.Directive#BLOCK

The following examples show how to use org.apache.velocity.runtime.directive.Directive#BLOCK . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IndentationFixer.java    From velocity-engine with Apache License 2.0 6 votes vote down vote up
@Override
public Object visit(ASTDirective node, Object data)
{
    String prefix = node.getPrefix();
    if (prefix.length() > 0)
    {
        if (extraIndentation == null)
        {
            fillExtraIndentation(prefix);
        }
        if (extraIndentation.length() > 0)
        {
            Matcher matcher = fix.matcher(prefix);
            node.setPrefix(matcher.replaceAll(parentIndentation));
            if (node.getDirectiveType() == Directive.BLOCK)
            {
                node.childrenAccept(this, null);
            }
        }
    }
    return null;
}
 
Example 2
Source File: ExceptionGeneratingDirective.java    From velocity-engine with Apache License 2.0 4 votes vote down vote up
public int getType()
{
    return Directive.BLOCK;
}