Class WalkerPRESERVE
java.lang.Object
org.jdom2.output.support.WalkerPRESERVE
- All Implemented Interfaces:
Walker
This Walker implementation walks a list of Content in its original RAW
format. There is no text manipulation, and all content will be returned as
the input type. In other words, next() will never be null, and text() will
always be null.
- Author:
- Rolf Lear
-
Constructor Summary
ConstructorsConstructorDescriptionWalkerPRESERVE(List<? extends Content> content) Create a Walker that preserves all content in its raw state. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()Behaves similarly to to a regular IteratorbooleanIf all the content in this walker is empty, or if whatever content is available is Text-like.booleanIf all the content is Text-like (Walker.isAllText()returns true), and additionally that any content is either Text or CDATA, and that the values of these Text/CDATA members are all XML Whitespace.booleanisCDATA()If the previous next() method returned null, then this will indicate whether the current text() value is CDATA or regular Text.next()Similar to an Iterator, but null return values need special treatment.text()If the previous call to next() returned null, then this will return the required text to be processed.
-
Constructor Details
-
WalkerPRESERVE
-
-
Method Details
-
isAllText
-
hasNext
-
next
-
text
Description copied from interface:WalkerIf 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. -
isCDATA
-
isAllWhitespace
public boolean isAllWhitespace()Description copied from interface:WalkerIf all the content is Text-like (Walker.isAllText()returns true), and additionally that any content is either Text or CDATA, and that the values of these Text/CDATA members are all XML Whitespace.- Specified by:
isAllWhitespacein interfaceWalker- Returns:
- true
-