Examples of ASTblock


Examples of org.apache.velocity.runtime.parser.node.ASTBlock

     * @throws IOException If something goes wrong.
     * @since 2.2.2
     */
    public static String getBodyAsString(InternalContextAdapter context, Node node)
            throws IOException {
        ASTBlock block = (ASTBlock) node.jjtGetChild(1);
        StringWriter stringWriter = new StringWriter();
        block.render(context, stringWriter);
        stringWriter.close();
        String body = stringWriter.toString();
        if (body != null) {
            body = body.replaceAll("^\\s*|\\s*$", "");
            if (body.length() <= 0) {
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

     * @throws IOException If something goes wrong.
     * @since 2.2.2
     */
    public static void evaluateBody(InternalContextAdapter context, Writer writer,
            Node node) throws IOException {
        ASTBlock block = (ASTBlock) node.jjtGetChild(1);
        block.render(context, writer);
    }
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

    }

    /** {@inheritDoc} */
    @Override
    public ModelBody createModelBody() {
        ASTBlock block = (ASTBlock) node.jjtGetChild(1);
        return new VelocityModelBody(context, block, writer);
    }
View Full Code Here

Examples of org.apache.velocity.runtime.parser.node.ASTBlock

    @Test
    public void testCreateModelBody() {
        InternalContextAdapter context = createMock(InternalContextAdapter.class);
        Writer writer = createMock(Writer.class);
        Node node = createMock(Node.class);
        ASTBlock block = createMock(ASTBlock.class);
        expect(node.jjtGetChild(1)).andReturn(block);
        replay(context, writer, node, block);
        VelocityAutotagRuntime runtime = new VelocityAutotagRuntime();
        runtime.render(context, writer, node);
        ModelBody modelBody = runtime.createModelBody();
View Full Code Here

Examples of org.lilypondbeans.jccparser.ASTBlock

        if (UpdateNodeTask.getInstance().getLastScore() == null) {
            toSearch = UpdateNodeTask.getInstance().lastRoot;
        } else {
            toSearch = UpdateNodeTask.getInstance().getLastScore();
        }
        ASTBlock best = ASTBlock.findPitchBlock(toSearch, 0, 0);
        if (best != null) {
            ASTTempNode nd = ASTTempNode.create("", best.jjtGetFirstToken().beginLine, best.jjtGetFirstToken().beginColumn, best);
            NetbeansTextEditor.getInstance().selectPosition(nd);
        }
    }
View Full Code Here

Examples of org.lilypondbeans.jccparser.ASTBlock

                    (value.repeat.jjtGetFirstToken().image.contains("tremolo")||
                    (value.repeat.jjtGetFirstToken().image.contains("unfold")))
                    )?true:false;
            if ((allwaysExpand||expandRepeats) && value.repeat != null && !weAreInRepeat) {
                //\repeat volta 2
                ASTBlock block = (ASTBlock) value.repeat.jjtGetChild(0);
                int repeats = Integer.parseInt(value.repeat.jjtGetFirstToken().image.split(" ")[2]);
                for (int r = 0; r < repeats; r++) {
                    expandRepeats(pos, block.getHighestBeatTime(), addBeatTime, true);
                    if (r + 1 != repeats) {
                        addBeatTime += block.getHighestBeatTime() - block.getBeattime();
                    }
                }
                pos = block.getHighestBeatTime();
                value = beattimeToPositions.get(pos);
                //2. repeat schließt sich unmittelbar an
                if(value.repeat!=null){
                    weAreInRepeat=false;
                    continue;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.