Package freemarker.ext.beans

Examples of freemarker.ext.beans.BooleanModel


    try {
      Object target = ((AdapterTemplateModel) arguments.get(0))
          .getAdaptedObject(Object.class);
      Class<?> clazz = Class.forName(((TemplateScalarModel) arguments.get(1))
          .getAsString());
      return new BooleanModel(new Boolean(clazz.isAssignableFrom(target
          .getClass())), wrapper);
    } catch (Exception ex) {
      throw new TemplateModelException("Could execute instanceof method.", ex);
    }
  }
View Full Code Here


      throw new TemplateModelException("Need 2 args: fromformat, toformat");
    }
    String fromFormat = (String) args.get(0);
    String toFormat = (String) args.get(1);
    boolean truefalse = ConverterFactory.isConvertible(fromFormat, toFormat);
    return new BooleanModel(truefalse,new DefaultObjectWrapper());
  }
View Full Code Here

        else if (simpleTestName.startsWith("overloaded-methods-") && !simpleTestName.startsWith("overloaded-methods-2-")) {
          dataModel.put("obj", new OverloadedMethods());
        }
       
        else if (simpleTestName.startsWith("boolean-formatting")) {
          dataModel.put("beansBoolean", new BooleanModel(Boolean.TRUE, (BeansWrapper) conf.getObjectWrapper()));
          dataModel.put("booleanAndString", new BooleanAndStringTemplateModel());
          dataModel.put("booleanVsStringMethods", new BooleanVsStringMethods());
        }
       
        else if (simpleTestName.startsWith("number-math-builtins")) {
View Full Code Here

TOP

Related Classes of freemarker.ext.beans.BooleanModel

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.