Examples of NumberTool


Examples of com.softsizo.report.html.tools.NumberTool

  protected String renderHtmlFromTemplate(String templateName,
      String contextName, Object data) throws Exception {
    Template template = getTemplate(templateName);
    VelocityContext context = new VelocityContext();
    context.put(contextName, data);
    context.put(NUMBER_CONTEXT_NAME, new NumberTool());
    context.put(NAMES_CONTEXT_NAME, new NamesTool());
    StringWriter w = new StringWriter();
    template.merge(context, w);
    return w.toString();
  }
View Full Code Here

Examples of org.apache.velocity.tools.generic.NumberTool

  public void addVelocityTools(VelocityContext context) {
    context.put("date", new MyDateTool(getBusiness().getTimeZone()));
    context.put("esc", new MyEscTool());
    context.put("link", new LinkTool());
    context.put("list", new ListTool());
    context.put("number", new NumberTool());
    context.put("render", new RenderTool());
    context.put("sorter", new SortTool());
    context.put("math", new MathTool());
    context.put("alternator", new AlternatorTool());
    context.put("comparisonDate", new ComparisonDateTool());
View Full Code Here

Examples of org.apache.velocity.tools.generic.NumberTool

        assertEquals(17,mathTool.toInteger("17"));
        assertEquals(18.1,mathTool.toDouble("18.1"));
    }

    public @Test void testNumberTool() {
        NumberTool numberTool = (NumberTool)toolbox.get("number");
        assertNotNull(numberTool);
//        assertEquals()
    }
View Full Code Here

Examples of org.apache.velocity.tools.generic.NumberTool

        assertEquals(17,mathTool.toInteger("17"));
        assertEquals(18.1,mathTool.toDouble("18.1"));
    }

    public @Test void testNumberTool() {
        NumberTool numberTool = (NumberTool)toolbox.get("number");
        assertNotNull(numberTool);
//        assertEquals()
    }
View Full Code Here

Examples of org.apache.velocity.tools.generic.NumberTool

        assertTrue(context.get("dateTool") instanceof DateTool);
        DateTool dateTool = (DateTool) context.get("dateTool");
        assertTrue(dateTool.getLocale().equals(Locale.CANADA));

        assertTrue(context.get("numberTool") instanceof NumberTool);
        NumberTool numberTool = (NumberTool) context.get("numberTool");
        assertTrue(numberTool.getLocale().equals(Locale.CANADA));
      }

      protected void exposeHelpers(Map model, HttpServletRequest request) throws Exception {
        model.put("myHelper", "myValue");
      }
View Full Code Here

Examples of org.apache.velocity.tools.generic.NumberTool

        assertEquals(17,mathTool.toInteger("17"));
        assertEquals(18.1,mathTool.toDouble("18.1"));
    }

    public @Test void testNumberTool() {
        NumberTool numberTool = (NumberTool)toolbox.get("number");
        assertNotNull(numberTool);
//        assertEquals()
    }
View Full Code Here

Examples of org.apache.velocity.tools.generic.NumberTool

        assertEquals(17,mathTool.toInteger("17"));
        assertEquals(18.1,mathTool.toDouble("18.1"));
    }

    public @Test void testNumberTool() {
        NumberTool numberTool = (NumberTool)toolbox.get("number");
        assertNotNull(numberTool);
//        assertEquals()
    }
View Full Code Here

Examples of org.apache.velocity.tools.generic.NumberTool

        assertEquals(17,mathTool.toInteger("17"));
        assertEquals(18.1,mathTool.toDouble("18.1"));
    }

    public @Test void testNumberTool() {
        NumberTool numberTool = (NumberTool)toolbox.get("number");
        assertNotNull(numberTool);
//        assertEquals()
    }
View Full Code Here

Examples of org.apache.velocity.tools.generic.NumberTool

        assertEquals(17,mathTool.toInteger("17"));
        assertEquals(18.1,mathTool.toDouble("18.1"));
    }

    public @Test void testNumberTool() {
        NumberTool numberTool = (NumberTool)toolbox.get("number");
        assertNotNull(numberTool);
//        assertEquals()
    }
View Full Code Here

Examples of org.apache.velocity.tools.generic.NumberTool

        assertTrue(context.get("dateTool") instanceof DateTool);
        DateTool dateTool = (DateTool) context.get("dateTool");
        assertTrue(dateTool.getLocale().equals(Locale.CANADA));

        assertTrue(context.get("numberTool") instanceof NumberTool);
        NumberTool numberTool = (NumberTool) context.get("numberTool");
        assertTrue(numberTool.getLocale().equals(Locale.CANADA));
      }

      @Override
      protected void exposeHelpers(Map<String, Object> model, HttpServletRequest request) throws Exception {
        model.put("myHelper", "myValue");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.