public class JythonSequenceModel extends JythonModel implements TemplateSequenceModel, TemplateCollectionModel
PySequence
descendants).object, wrapper
NOTHING
FALSE, TRUE
EMPTY_STRING
Constructor and Description |
---|
JythonSequenceModel(org.python.core.PyObject object,
JythonWrapper wrapper) |
Modifier and Type | Method and Description |
---|---|
TemplateModel |
get(int index)
Returns
PyObject.__finditem__(int) . |
TemplateModelIterator |
iterator()
Retrieves a template model iterator that is used to iterate over
the elements in this collection.
|
int |
size()
Returns
PyObject.__len__() . |
exec, get, getAdaptedObject, getAsBoolean, getAsString, getWrappedObject, isEmpty
public JythonSequenceModel(org.python.core.PyObject object, JythonWrapper wrapper)
public TemplateModel get(int index) throws TemplateModelException
PyObject.__finditem__(int)
.get
in interface TemplateSequenceModel
null
if
the index is out of bounds. Note that a null
value 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.TemplateModelException
public int size() throws TemplateModelException
PyObject.__len__()
.size
in interface TemplateSequenceModel
TemplateModelException
public TemplateModelIterator iterator()
TemplateCollectionModel
iterator
in interface TemplateCollectionModel