Top Description Fields Constructors Methods
org.jdom2.output.support

public Class WalkerPRESERVE

extends Object
implements Walker
Class Inheritance
All Implemented Interfaces
org.jdom2.output.support.Walker
Imports
java.util.Iterator, .List, .NoSuchElementException, org.jdom2.Content

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

Field Summary

Modifier and TypeField and Description
private final boolean
private static final Iterator<Content>
private final Iterator<? extends Content>

Constructor Summary

AccessConstructor and Description
public
WalkerPRESERVE(final List<? extends Content>
the content to walk.
content
)

Create a Walker that preserves all content in its raw state.

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements org.jdom2.output.support.Walker.hasNext.

Behaves similarly to to a regular Iterator
public boolean
isAllText()

Implements org.jdom2.output.support.Walker.isAllText.

If all the content in this walker is empty, or if whatever content is available is Text-like.
public boolean
isAllWhitespace()

Implements org.jdom2.output.support.Walker.isAllWhitespace.

If all the content is Text-like (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.
public boolean
isCDATA()

Implements org.jdom2.output.support.Walker.isCDATA.

If the previous next() method returned null, then this will indicate whether the current text() value is CDATA or regular Text.
public Content
next()

Implements org.jdom2.output.support.Walker.next.

Similar to an Iterator, but null return values need special treatment.
public String
text()

Implements org.jdom2.output.support.Walker.text.

If the previous call to next() returned null, then this will return the required text to be processed.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alltextback to summary
private final boolean alltext
EMPTYITback to summary
private static final Iterator<Content> EMPTYIT
iterback to summary
private final Iterator<? extends Content> iter

Constructor Detail

WalkerPRESERVEback to summary
public WalkerPRESERVE(final List<? extends Content> content)

Create a Walker that preserves all content in its raw state.

Parameters
content:List<? extends Content>

the content to walk.

Method Detail

hasNextback to summary
public boolean hasNext()

Implements org.jdom2.output.support.Walker.hasNext.

Doc from org.jdom2.output.support.Walker.hasNext.

Behaves similarly to to a regular Iterator

Returns:boolean

true if there is more content to be processed

Annotations
@Override
isAllTextback to summary
public boolean isAllText()

Implements org.jdom2.output.support.Walker.isAllText.

Doc from org.jdom2.output.support.Walker.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 Text, CDATA, EntityRef, or any (potentially mixed) sequence of these types, but no other types.

Returns:boolean

true if there is no content, or all content is Text

Annotations
@Override
isAllWhitespaceback to summary
public boolean isAllWhitespace()

Implements org.jdom2.output.support.Walker.isAllWhitespace.

Doc from org.jdom2.output.support.Walker.isAllWhitespace.

If all the content is Text-like (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.

Returns:boolean

true

Annotations
@Override
isCDATAback to summary
public boolean isCDATA()

Implements org.jdom2.output.support.Walker.isCDATA.

Doc from org.jdom2.output.support.Walker.isCDATA.

If the previous next() method returned null, then this will indicate whether the current text() value is CDATA or regular Text.

Returns:boolean

true if the current text() is valid, and is CDATA.

Annotations
@Override
nextback to summary
public Content next()

Implements org.jdom2.output.support.Walker.next.

Doc from org.jdom2.output.support.Walker.next.

Similar to an Iterator, but null return values need special treatment.

Returns:Content

the next content to be processed, perhaps null if the next content is re-formatted text of some sort (Text / CDATA).

Annotations
@Override
textback to summary
public String text()

Implements org.jdom2.output.support.Walker.text.

Doc from org.jdom2.output.support.Walker.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.

Returns:String

The current text value (null if the previous invocation of next() returned a non-null value).

Annotations
@Override