Package org.apache.velocity.tools.generic

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


        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

        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

        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

        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

        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

        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

        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

        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

    Velocity.init();
    tmp = Velocity.getTemplate(xml.getName(),"UTF-8");
    context.put("convert", new ConversionTool());
    context.put("dateTool", new DateTool());
    context.put("mathTool", new MathTool());
    context.put("numberTool", new NumberTool());
    context.put("Math", new myMath());
  }
View Full Code Here

TOP

Related Classes of org.apache.velocity.tools.generic.NumberTool

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.