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( "empty" )) {
            return new SimpleScalar( "Dummy hash value, for test purposes." );
        } else {
            return null;
        }
    }
View Full Code Here


    public String getAsString() throws TemplateModelException {
        return "scalarValue";
    }

    public TemplateModel get(String key) throws TemplateModelException {
        return new SimpleScalar("mapValue for " + key);
    }
View Full Code Here

        }
       
        public TemplateModel get(String key) throws TemplateModelException
        {
            String s = configurable.getSetting(key);
            return s == null ? null : new SimpleScalar(s);
        }
View Full Code Here

        private final SimpleScalar name;

        DebugTemplateModel(Template template)
        {
            super(template);
            this.name = new SimpleScalar(template.getName());
        }
View Full Code Here

            return EMPTY_ITERATOR;
        }
    };
   
    public TemplateModel get(String key) throws TemplateModelException {
        return new SimpleScalar("value for key " + key);
    }
View Full Code Here

        if (array == null) {
            array = new TemplateScalarModel[stringArray.length];
        }
        TemplateScalarModel result = array[index];
        if (result == null) {
            result = new SimpleScalar(stringArray[index]);
            array[index] = result;
        }
        return result;
    }
View Full Code Here

    {
        SimpleHash model = new SimpleHash();
        for (Iterator it = table.entrySet().iterator(); it.hasNext();)
        {
            Map.Entry entry = (Map.Entry)it.next();
            model.put(String.valueOf(entry.getKey()), new SimpleScalar(String.valueOf(entry.getValue())));
        }
        return model;
    }
View Full Code Here

            this.constantValue = null;
        }
    }
   
    TemplateModel _eval(Environment env) throws TemplateException {
        return new SimpleScalar(evalAndCoerceToString(env));
    }
View Full Code Here

            }
            if (xresult instanceof XNull) {
                return null;
            }
            if (xresult instanceof XString) {
                return new SimpleScalar(xresult.toString());
            }
            if (xresult instanceof XNumber) {
                return new SimpleNumber(new Double(((XNumber) xresult).num()));
            }
            throw new TemplateModelException("Cannot deal with type: " + xresult.getClass().getName());
View Full Code Here

    }

    public TemplateModel get(String key)
    {
        String value = request.getParameter(key);
        return value == null ? null : new SimpleScalar(value);
    }
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.