Package freemarker.ext.jython
Class JythonNumberModel
java.lang.Object
freemarker.ext.jython.JythonModel
freemarker.ext.jython.JythonNumberModel
- All Implemented Interfaces:
WrapperTemplateModel,AdapterTemplateModel,TemplateBooleanModel,TemplateHashModel,TemplateMethodModel,TemplateMethodModelEx,TemplateModel,TemplateNumberModel,TemplateScalarModel
Model for Jython numeric objects (
PyInteger, PyLong,
PyFloat).-
Field Summary
Fields inherited from class freemarker.ext.jython.JythonModel
object, wrapperFields inherited from interface freemarker.template.TemplateBooleanModel
FALSE, TRUEFields inherited from interface freemarker.template.TemplateModel
NOTHINGFields inherited from interface freemarker.template.TemplateScalarModel
EMPTY_STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns eitherPyObject.__tojava__(java.lang.Class)withNumber.class as argument.Methods inherited from class freemarker.ext.jython.JythonModel
exec, get, getAdaptedObject, getAsBoolean, getAsString, getWrappedObject, isEmpty
-
Constructor Details
-
JythonNumberModel
-
-
Method Details
-
getAsNumber
Returns eitherPyObject.__tojava__(java.lang.Class)withNumber.class as argument. If that fails, returnsPyObject.__float__().- Specified by:
getAsNumberin interfaceTemplateNumberModel- Returns:
- the
Numberinstance associated with this number model. - Throws:
TemplateModelException
-