Implementations of this class restructure the content to a particular format and expose the restructured content in this 'Walker' which is a loose equivalent to an iterator.
The next() method will return a Content instance (perhaps null) if there is more content. If the returned content is null, then there will be some formatted characters available in the text() method. These characters may need to be represented as CDATA (check the isCDATA() method).
Not all CDATA and Text nodes need to be reformatted, and as a result they may be returned as their original CDATA or Text instances instead of using the formatted text() / isCDATA() mechanism.
The 'Rules' for the walkers are that no padding is done before the first content step, and no padding is done after the last content step (but the first/last content items may be trimmed to the correct format). Any required padding will be done in plain text (not CDATA) content. Consecutive CDATA sections may be separated by whitespace text for example.
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if there is more content to be processedBehaves similarly to to a regular Iterator |
| public boolean | Returns: true if there is no content, or all content is TextIf all the content in this walker is empty, or if whatever content is available is Text-like. |
| public boolean | Returns: trueIf all the content is Text-like ( |
| public boolean | Returns: true if the current text() is valid, and is CDATA.If the previous next() method returned null, then this will indicate whether the current text() value is CDATA or regular Text. |
| public Content | Returns: the next content to be processed, perhaps null if the next content is re-formatted text of some sort (Text / CDATA).Similar to an Iterator, but null return values need special treatment. |
| public String | Returns: The current text value (null if the previous invocation of next() returned a non-null value).If the previous call to next() returned null, then this will return the required text to be processed. |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Behaves similarly to to a regular Iterator
| |
| isAllText | back to summary |
|---|---|
| public boolean isAllText() If all the content in this walker is empty, or if whatever content is available is Text-like.
Text-like content is considered to be
| |
| isAllWhitespace | back to summary |
|---|---|
| public boolean isAllWhitespace() If all the content is Text-like (
| |
| isCDATA | back to summary |
|---|---|
| public boolean isCDATA() If the previous next() method returned null, then this will indicate whether the current text() value is CDATA or regular Text.
| |
| next | back to summary |
|---|---|
| public Content next() Similar to an Iterator, but null return values need special treatment.
| |
| text | back to summary |
|---|---|
| public String text() If the previous call to next() returned null, then this will return the required text to be processed. Check to see whether this text is CDATA by calling the isCDATA() method.
| |