org.apache.sling.commons.html

## Class HtmlIterator

- java.lang.Object
- - org.apache.sling.commons.html.HtmlIterator

All Implemented Interfaces:
  Iterator<HtmlElement>

    public class HtmlIterator
    extends Object
    implements Iterator<HtmlElement>

Pull based iterator which processes an input stream and converts the stream into a series of HtmlElement Tokens

### Constructor Summary

Constructors
Constructor and Description
`HtmlIterator(InputStream is)` Convert InputStream into a series of HtmlElement tokens, using the systems default character encoding
`HtmlIterator(InputStream is, String encoding)` Convert InputStream into a series of HtmlElement tokens, using the provided character encoding

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `hasNext()` searches for and indicates whether the next HtmlElement has been found.
`HtmlElement` `next()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.Iterator

`forEachRemaining, remove`

### Constructor Detail

#### HtmlIterator

    public HtmlIterator(InputStream is)

Convert InputStream into a series of HtmlElement tokens, using the systems default character encoding

Parameters:
  `is` -

#### HtmlIterator

    public HtmlIterator(InputStream is,
                        String encoding)

Convert InputStream into a series of HtmlElement tokens, using the provided character encoding

Parameters:
  `is` -
  `encoding` -

### Method Detail

#### hasNext

    public boolean hasNext()

searches for and indicates whether the next HtmlElement has been found.

Specified by:
  `hasNext` in interface `Iterator<HtmlElement>`

#### next

    public HtmlElement next()

Specified by:
  `next` in interface `Iterator<HtmlElement>`