string.formatter_field_name_split(). The function
formatter_field_name_split() returns a pair (tuple)
consisting of a head element and an instance of this iterator.
The constructor of this class effectively implements that
function, since as well as being the iterator (second member),
the object has an extra method head() to return the
required first member of the pair.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | bytes
True if originally given a PyString (so must return PyString not PyUnicode). |
| private Object | |
| private int | index
How far along that string we are. |
| private final String | markup
The UTF-16 string from which elements are being returned. |
| public static final PyType | TYPE
The Python type |
| Access | Constructor and Description |
|---|---|
| public | FieldNameIterator(String
the field name as UTF-16 fieldName, boolean true if elements returned should be bytes bytes)Create an iterator for the parts of this field name (and extract the head name field, which may be an empty string). |
| public | FieldNameIterator(String
to parse fieldName)Create an iterator for the parts of this field name (and extract the head name field, which may be an empty string). |
| Modifier and Type | Method and Description |
|---|---|
| private final Object | |
| private final Object | |
| public PyType | |
| public Object | Returns: the isolated head object from the field name.Return the head object from the field name, as |
| public FieldNameIterator. | Returns: next element of the field nameReturn the next "chunk" of the field name (or return null if ended). |
| private int | |
| private void | |
| private void |
| bytes | back to summary |
|---|---|
| private final boolean bytes True if originally given a PyString (so must return PyString not PyUnicode). | |
| head | back to summary |
|---|---|
| private Object head | |
| index | back to summary |
|---|---|
| private int index How far along that string we are. | |
| markup | back to summary |
|---|---|
| private final String markup The UTF-16 string from which elements are being returned. | |
| TYPE | back to summary |
|---|---|
| public static final PyType TYPE The Python type | |
| FieldNameIterator | back to summary |
|---|---|
| public FieldNameIterator(String fieldName, boolean bytes) Create an iterator for the parts of this field name (and extract the head name field, which may be an empty string). According to the Python Standard Library documentation, a replacement field name has the structure:
field_name ::= arg_name ("." attribute_name | "[" element_index "]")*
arg_name ::= [identifier | integer]
attribute_name ::= identifier
element_index ::= integer | index_string
The object is used from PyUnicode and from PyString, and we have
to signal which it is, so that returned values may match in type.
| |
| FieldNameIterator | back to summary |
|---|---|
| public FieldNameIterator(String fieldName) Create an iterator for the parts of this field name (and extract the head name field, which may be an empty string).
| |
| __iter__ | back to summary |
|---|---|
private final Object __iter__()
| |
| __next__ | back to summary |
|---|---|
private final Object __next__()
| |
| getType | back to summary |
|---|---|
| public PyType getType() Implements org. Doc from org. The Python | |
| head | back to summary |
|---|---|
| public Object head() Return the head object from the field name, as
| |
| nextChunk | back to summary |
|---|---|
| public FieldNameIterator. Return the next "chunk" of the field name (or return null if ended). A chunk is a 2-tuple describing:
| |
| nextDotOrBracket | back to summary |
|---|---|
| private int nextDotOrBracket(String markup) | |
| parseAttrChunk | back to summary |
|---|---|
| private void parseAttrChunk(FieldNameIterator. | |
| parseItemChunk | back to summary |
|---|---|
| private void parseItemChunk(FieldNameIterator. | |
| Modifier and Type | Field and Description |
|---|---|
| public boolean | |
| public Object | value
Integer or String. |
| Access | Constructor and Description |
|---|---|
| public |
| is_attr | back to summary |
|---|---|
| public boolean is_attr | |
| value | back to summary |
|---|---|
| public Object value Integer or String. | |
| Chunk | back to summary |
|---|---|
| public Chunk() | |