Package freemarker.template

Examples of freemarker.template.SimpleScalar


     * @return the <tt>TemplateModel</tt> referred to by the key,
     * or null if not found.
     */
    public TemplateModel get(String key) {
        if( key.equals( "selftest" )) {
            return new SimpleScalar( "Selftest from MultiModel3!" );
        } else if( key.equals( "message" )) {
            return new SimpleScalar( "Hello world from MultiModel3!" );
        } else {
            return null;
        }
    }
View Full Code Here


     * the values of the arguments passed to the method.
     * @return the <tt>TemplateModel</tt> produced by the method, or null.
     */
    public Object exec(List arguments) {
        if( arguments.size() == 0 ) {
            return new SimpleScalar( "Empty list provided" );
        } else if( arguments.size() > 1 ) {
            return new SimpleScalar( "Argument size is: " + arguments.size() );
        } else {
            return new SimpleScalar( "Single argument value is: " + arguments.get(0) );
        }
    }
View Full Code Here

       
        try
        {
            String s = target.evalAndCoerceToString(env);
            try {
                return new SimpleScalar(s.substring(index, index + 1));
            } catch (IndexOutOfBoundsException e) {
                if (index < 0) {
                    throw new _MiscTemplateException(new Object[] {
                                "Negative index not allowed: ",
                                new Integer(index) });
View Full Code Here

                }
            } else {
                exclEndIdx = firstIdx + resultSize;
            }
           
            return new SimpleScalar(targetStr.substring(firstIdx, exclEndIdx));
        }
    }
View Full Code Here

        }
       
        private final BIBeforeICI2d3d20 prevICIObj = new BIBeforeICI2d3d20();
       
        TemplateModel calculateResult(String s, Environment env) {
            return new SimpleScalar(StringUtil.XHTMLEnc(s));
        }
View Full Code Here

    static class htmlBI extends BuiltInForString implements ICIChainMember {
       
        static class BIBeforeICI2d3d20 extends BuiltInForString {
            TemplateModel calculateResult(String s, Environment env) {
                return new SimpleScalar(StringUtil.HTMLEnc(s));
            }
View Full Code Here

        }
    }

    static class j_stringBI extends BuiltInForString {
        TemplateModel calculateResult(String s, Environment env) {
            return new SimpleScalar(StringUtil.javaStringEnc(s));
        }
View Full Code Here

        }
    }

    static class js_stringBI extends BuiltInForString {
        TemplateModel calculateResult(String s, Environment env) {
            return new SimpleScalar(StringUtil.javaScriptStringEnc(s));
        }
View Full Code Here

        }
    }

    static class json_stringBI extends BuiltInForString {
        TemplateModel calculateResult(String s, Environment env) {
            return new SimpleScalar(StringUtil.jsonStringEnc(s));
        }
View Full Code Here

        }
    }

    static class rtfBI extends BuiltInForString {
        TemplateModel calculateResult(String s, Environment env) {
            return new SimpleScalar(StringUtil.RTFEnc(s));
        }
View Full Code Here

TOP

Related Classes of freemarker.template.SimpleScalar

Copyright © 2018 www.massapicom. 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.