1 52 53 package freemarker.ext.beans; 54 55 import freemarker.ext.util.ModelFactory; 56 import freemarker.template.ObjectWrapper; 57 import freemarker.template.TemplateModel; 58 import freemarker.template.TemplateNumberModel; 59 60 65 public class NumberModel 66 extends 67 BeanModel 68 implements 69 TemplateNumberModel 70 { 71 static final ModelFactory FACTORY = 72 new ModelFactory() 73 { 74 public TemplateModel create(Object object, ObjectWrapper wrapper) 75 { 76 return new NumberModel((Number )object, (BeansWrapper)wrapper); 77 } 78 }; 79 87 public NumberModel(Number number, BeansWrapper wrapper) 88 { 89 super(number, wrapper); 90 } 91 92 public Number getAsNumber() 93 { 94 return (Number )object; 95 } 96 } 97 | Popular Tags |