Package freemarker.ext.beans

Examples of freemarker.ext.beans.StringModel


            if (tm instanceof StringModel) {
                String original = ((StringModel) tm).getAsString();
                if (original != null) {
                    String encoded = StringUtil.htmlEncoder.encode(original);
                    if (!original.equals(encoded)) {
                        return new StringModel(encoded, this.wrapper);
                    }
                }
            }
            return tm;
        }
View Full Code Here


            if (tm instanceof StringModel) {
                String original = ((StringModel) tm).getAsString();
                if (original != null) {
                    String encoded = StringUtil.htmlEncoder.encode(original);
                    if (!original.equals(encoded)) {
                        return new StringModel(encoded, this.wrapper);
                    }
                }
            }
            return tm;
        }
View Full Code Here

    }
    else if (obj instanceof WsdlInfo) {
      return new WsdlInfoModel((WsdlInfo) obj, this);
    }
    else if (obj instanceof JavaDoc) {
      return new StringModel(obj, this);
    }
    else {
      return super.wrap(obj);
    }
  }
View Full Code Here

        } else {
            if(!(beanParam instanceof StringModel)) {
                throw new TemplateException("<@writeAttribs> directive parameter 'bean' not defined properly.  Should be a valid model object reference (no quotes) e.g. <@writeAttribs bean=customer.address ... />.", environment);
            }

            StringModel beanModel = (StringModel) beanParam;
            bean = beanModel.getWrappedObject();
        }

        SimpleScalar attribsScalar = (SimpleScalar) params.get("attribs");
        if(attribsScalar == null) {
            if(params.containsKey("attribs")) {
View Full Code Here

        if(!(beanParam instanceof StringModel)) {
            throw new TemplateException("Mandatory <@" + directiveName + "> directive parameter 'bean' not defined properly.  Should be a valid model object reference (no quotes) e.g. <@" + directiveName + " bean=customer.address />.", environment);
        }

        StringModel beanModel = (StringModel) beanParam;

        return beanModel.getWrappedObject();
    }
View Full Code Here

           
            @Override
            public TemplateModel get(String key) throws TemplateModelException {
                String value = (String) env.get(key);
                if(value != null) {
                    return new StringModel(value, bw);
                } else {
                    return null;
                }
            }
        });
View Full Code Here

  public Object exec(List paras) throws TemplateModelException {

    // TemplateModel model =
    // Environment.getCurrentEnvironment().getVariable("lineData");
    StringModel p1 = (StringModel) paras.get(0);
    StringModel p2 = (StringModel) paras.get(1);
    if (p2 != null) {
      BOInstance data = null;
      if (p1 != null) {
        data = (BOInstance) p1.getWrappedObject();
      }
      DOFormModel fm = (DOFormModel) p2.getWrappedObject();
      fm.setData(data);
     
      if (data != null) {
        if (!fm.isAccess(data)) {
          return "false";
View Full Code Here

TOP

Related Classes of freemarker.ext.beans.StringModel

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.