Examples of TextScript


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

            List list = block.getScriptList();
            int size = list.size();
            if ( size > 0 ) {
                Script script = (Script) list.get(0);
                if ( script instanceof TextScript ) {
                    TextScript textScript = (TextScript) script;
                    textScript.trimStartWhitespace();
                }
                if ( size > 1 ) {
                    script = (Script) list.get(size - 1);
                  if ( script instanceof TextScript ) {
                      TextScript textScript = (TextScript) script;
                      textScript.trimEndWhitespace();
                  }
                }
            }
        }
        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();
                    text = text.trim();
                    if ( text.length() == 0 ) {
                        list.remove(i);
                    }
                    else {
                        textScript.setText(text);
                    }
                }
            }               
        }
        else if ( body instanceof TextScript ) {
            TextScript textScript = (TextScript) body;
            textScript.trimWhitespace();
        }

        this.hasTrimmed = true;
    }
View Full Code Here

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

        if ( expression instanceof ConstantExpression ) {
            ConstantExpression constantExpression
                = (ConstantExpression) expression;
            Object value = constantExpression.getValue();
            if ( value != null ) {
                script.addScript(new TextScript( value.toString() ));
            }
        }
        else
        if ( expression instanceof CompositeExpression ) {
            CompositeTextScriptBlock newBlock = new CompositeTextScriptBlock();
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.