Examples of ScriptBlock


Examples of org.apache.commons.jelly.impl.ScriptBlock

                    textBuffer.setLength(0);
                }
                script.addScript(tagScript);
                // start a new body
                scriptStack.push(script);
                script = new ScriptBlock();
                tagScript.setTagBody(script);
            }
            else {
                // XXXX: might wanna handle empty elements later...
                textBuffer.append("<");
View Full Code Here

Examples of org.apache.commons.jelly.impl.ScriptBlock

                CompositeTextScriptBlock block = (CompositeTextScriptBlock) body;
                block.trimWhitespace();
            }
            else
            if ( body instanceof ScriptBlock ) {
                ScriptBlock block = (ScriptBlock) body;
                block.trimWhitespace();
            }
            else if ( body instanceof TextScript ) {
                TextScript textScript = (TextScript) body;
                textScript.trimWhitespace();
            }
View Full Code Here

Examples of org.apache.commons.jelly.impl.ScriptBlock

                }
            }
        }
        else
        if ( body instanceof ScriptBlock ) {
            ScriptBlock block = (ScriptBlock) body;
            List list = block.getScriptList();
            for ( int i = list.size() - 1; i >= 0; i-- ) {
                Script script = (Script) list.get(i);
                if ( script instanceof TextScript ) {
                    TextScript textScript = (TextScript) script;
                    String text = textScript.getText();
View Full Code Here

Examples of org.apache.commons.jelly.impl.ScriptBlock

     * Process notification of the beginning of the document being reached.
     *
     * @exception SAXException if a parsing error is to be reported
     */
    public void startDocument() throws SAXException {
        script = new ScriptBlock();
        textBuffer = new StringBuffer();
        tagScript = null;
        parentTag = null;
        scriptStack.clear();
        tagScriptStack.clear();
View Full Code Here

Examples of org.apache.commons.jelly.impl.ScriptBlock

                    textBuffer.setLength(0);
                }
                script.addScript(tagScript);
                // start a new body
                scriptStack.push(script);
                script = new ScriptBlock();
                tag.setBody(script);
            }
            else {
                // XXXX: might wanna handle empty elements later...
                textBuffer.append("<");
View Full Code Here

Examples of org.apache.commons.jelly.impl.ScriptBlock

        // XXX: iterate through the body....
        List whenTagList = new ArrayList();
        otherwiseTag = null;
        Script body = getBody();
        if (body instanceof ScriptBlock) {
            ScriptBlock block = (ScriptBlock) body;
            for (Iterator iter = block.getScriptList().iterator(); iter.hasNext();) {
                Script script = (Script) iter.next();
                if (script instanceof TagScript) {
                    TagScript tagScript = (TagScript) script;
                    Tag tag = tagScript.getTag();
                    if (tag instanceof WhenTag) {
View Full Code Here

Examples of org.gradle.groovy.scripts.internal.ScriptBlock

        ModelRegistryDslHelperStatementGenerator statementGenerator = new ModelRegistryDslHelperStatementGenerator();
        BlockStatement rootStatementBlock = source.getAST().getStatementBlock();
        ListIterator<Statement> statementsIterator = rootStatementBlock.getStatements().listIterator();
        while (statementsIterator.hasNext()) {
            Statement statement = statementsIterator.next();
            ScriptBlock scriptBlock = AstUtils.detectScriptBlock(statement, SCRIPT_BLOCK_NAMES);
            if (scriptBlock != null) {
                statementsIterator.remove();
                ScopeVisitor scopeVisitor = new ScopeVisitor(source, statementGenerator);
                scriptBlock.getClosureExpression().getCode().visit(scopeVisitor);
            }
        }
        rootStatementBlock.addStatements(statementGenerator.getGeneratedStatements());
    }
View Full Code Here

Examples of org.gradle.groovy.scripts.internal.ScriptBlock

            return;
        }

        List<Statement> statements = source.getAST().getStatementBlock().getStatements();
        for (Statement statement : statements) {
            ScriptBlock scriptBlock = AstUtils.detectScriptBlock(statement, SCRIPT_BLOCK_NAMES);
            if (scriptBlock == null) {
                // Look for model(«») (i.e. call to model with anything other than non literal closure)
                MethodCallExpression methodCall = AstUtils.extractBareMethodCall(statement);
                if (methodCall == null) {
                    continue;
                }

                String methodName = AstUtils.extractConstantMethodName(methodCall);
                if (methodName == null) {
                    continue;
                }

                if (methodName.equals(MODEL)) {
                    source.getErrorCollector().addError(
                            new SyntaxException(NON_LITERAL_CLOSURE_TO_TOP_LEVEL_MODEL_MESSAGE, statement.getLineNumber(), statement.getColumnNumber()),
                            source
                    );
                }
            } else {
                RuleVisitor ruleVisitor = new RuleVisitor(source);
                RulesVisitor rulesVisitor = new RulesVisitor(source, ruleVisitor);
                scriptBlock.getClosureExpression().getCode().visit(rulesVisitor);
            }
        }
    }
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.