FileDocCategorySizeDatePackage
TextOptimizer.javaAPI DocGlassfish v2 API5523Wed Jul 11 16:32:12 BST 2007org.apache.jasper.compiler

TextOptimizer

public class TextOptimizer extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidconcatenate(Compiler compiler, Node.Nodes page)


        Options options = compiler.getCompilationContext().getOptions();
        PageInfo pageInfo = compiler.getPageInfo();
        boolean trim =
            options.getTrimSpaces() || pageInfo.isTrimDirectiveWhitespaces();

        if (trim) {
            TextCatVisitor v = new TextCatVisitor(true, trim);
            page.visit(v);
            v.collectText();
        }
        TextCatVisitor v = new TextCatVisitor(false, trim);
        page.visit(v);

	// Cleanup, in case the page ends with a template text
        v.collectText();