Package freemarker.template

Examples of freemarker.template.SimpleScalar


        Object o = args.get("expireTime");
        Debug.log("ExpireTime Object - " + o, module);
        long expireTime = 0;
        if (o != null) {
            if (o instanceof SimpleScalar) {
                SimpleScalar s = (SimpleScalar) o;
                String ets = s.getAsString();
                Debug.log("ExpireTime String - " + ets, module);
                try {
                    expireTime = Long.parseLong(ets);
                } catch (Exception e) {
                    Debug.logError(e, module);
View Full Code Here


        Object o = args.get("include");
        Debug.log("Include Object - " + o, module);
        String include = null;
        if (o != null) {
            if (o instanceof SimpleScalar) {
                SimpleScalar s = (SimpleScalar) o;
                include = s.getAsString();
                Debug.log("Include String - " + include, module);
            }
        }
        return include;
    }
View Full Code Here

        String screenValue = "";
        if (results != null)
        {
            screenValue = results.toString();
        }
        context.put("screen_placeholder", new SimpleScalar(screenValue));

        // Variable to reference the navigation templates in the
        // layout template.
        context.put("navigation", new NavigationModel(data));
View Full Code Here

            if (o instanceof SimpleNumber) {
                SimpleNumber s = (SimpleNumber) o;
                return s.getAsNumber().intValue();
            }
            if (o instanceof SimpleScalar) {
                SimpleScalar s = (SimpleScalar) o;
                return new Integer( s.getAsString() );
            }
            return new Integer(o.toString());
        }
        return 0;
    }
View Full Code Here

        if (!args.containsKey(key)) {       
            return defaultValue;
        } else {
            Object o = args.get(key);
            if (o instanceof SimpleScalar) {
                SimpleScalar s = (SimpleScalar) o;
                return "true".equalsIgnoreCase(s.getAsString());
            }
            return defaultValue;
        }
    }
View Full Code Here

        Object o = args.get("expireTime");
        Debug.log("ExpireTime Object - " + o, module);
        long expireTime = 0;
        if (o != null) {
            if (o instanceof SimpleScalar) {
                SimpleScalar s = (SimpleScalar) o;
                String ets = s.getAsString();
                Debug.log("ExpireTime String - " + ets, module);
                try {
                    expireTime = Long.parseLong(ets);
                } catch (Exception e) {
                    Debug.logError(e, module);
View Full Code Here

        Object o = args.get("include");
        Debug.log("Include Object - " + o, module);
        String include = null;
        if (o != null) {
            if (o instanceof SimpleScalar) {
                SimpleScalar s = (SimpleScalar) o;
                include = s.getAsString();
                Debug.log("Include String - " + include, module);
            }
        }
        return include;
    }
View Full Code Here

            if (o instanceof SimpleNumber) {
                SimpleNumber s = (SimpleNumber) o;
                return new Double( s.getAsNumber().doubleValue() );
            }
            if (o instanceof SimpleScalar) {
                SimpleScalar s = (SimpleScalar) o;
                return new Double( s.getAsString() );
            }
            return new Double( o.toString() );
        }
        return new Double(0.00);
    }
View Full Code Here

            value = ((TemplateNumberModel) args.get(1)).getAsNumber();
        if (args.get(1) instanceof BeanModel)
            value = ((BeanModel) args.get(1)).getWrappedObject();       
                      
        request.setAttribute(name, value);              
        return new SimpleScalar("");
    }
View Full Code Here

            if (o instanceof SimpleNumber) {
                SimpleNumber s = (SimpleNumber) o;
                return s.getAsNumber().doubleValue();
            }
            if (o instanceof SimpleScalar) {
                SimpleScalar s = (SimpleScalar) o;
                return new Double( s.getAsString() );
            }
            return new Double( o.toString() );
        }
        return 0.00;
    }
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.