Package freemarker.ext.jython
Class JythonSequenceModel
java.lang.Object
freemarker.ext.jython.JythonModel
freemarker.ext.jython.JythonSequenceModel
- All Implemented Interfaces:
WrapperTemplateModel,AdapterTemplateModel,TemplateBooleanModel,TemplateCollectionModel,TemplateHashModel,TemplateMethodModel,TemplateMethodModelEx,TemplateModel,TemplateScalarModel,TemplateSequenceModel
public class JythonSequenceModel
extends JythonModel
implements TemplateSequenceModel, TemplateCollectionModel
Model for Jython sequence objects (
PySequence descendants).-
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
ConstructorsConstructorDescriptionJythonSequenceModel(org.python.core.PyObject object, JythonWrapper wrapper) -
Method Summary
Methods inherited from class freemarker.ext.jython.JythonModel
exec, get, getAdaptedObject, getAsBoolean, getAsString, getWrappedObject, isEmpty
-
Constructor Details
-
JythonSequenceModel
-
-
Method Details
-
get
ReturnsPyObject.__finditem__(int).- Specified by:
getin interfaceTemplateSequenceModel- Returns:
- the item at the specified index, or
nullif the index is out of bounds. Note that anullvalue is interpreted by FreeMarker as "variable does not exist", and accessing a missing variables is usually considered as an error in the FreeMarker Template Language, so the usage of a bad index will not remain hidden, unless the default value for that case was also specified in the template. - Throws:
TemplateModelException
-
size
ReturnsPyObject.__len__().- Specified by:
sizein interfaceTemplateSequenceModel- Returns:
- the number of items in the list.
- Throws:
TemplateModelException
-
iterator
Description copied from interface:TemplateCollectionModelRetrieves a template model iterator that is used to iterate over the elements in this collection.- Specified by:
iteratorin interfaceTemplateCollectionModel
-