org.apache.sling.commons.html.impl.parser

## Class TagParser

- java.lang.Object
- - org.apache.sling.commons.html.impl.parser.TagParser

All Implemented Interfaces:
  TagParserConstants

    public class TagParser
    extends Object
    implements TagParserConstants

### Field Summary

Fields
`Token` `jj_nt` Next token.
`Token` `token` Current token.
`TagParserTokenManager` `token_source` Generated Token Manager.

### Fields inherited from interface org.apache.sling.commons.html.impl.parser.TagParserConstants

`ATTR_EQ, ATTR_IDENTIFIER, ATTR_NAME, ATTR_VAL, ATTR_VALUE, COMMENT, COMMENT_END, COMMENT_START, COMMENT_WORD, DECL_ATTR, DECL_END, DECL_START, DECL_TAG, DECLARATION, DEFAULT, DQUOTE, END_OF_TAG, ENDTAG_START, EOF, ERROR, IN_DECLARATION, IN_TAG, LIT_ERROR, LST_ERROR, NAME_IDENTIFIER, RAWTEXT, SPACE, SQUOTE, START_TAG, STRING, TAG_END, TAG_NAME, TAG_SLASHEND, TAG_START, tokenImage`

### Constructor Summary

Constructors
Constructor and Description
`TagParser(InputStream stream)` Constructor with InputStream.
`TagParser(InputStream stream, String encoding)` Constructor with InputStream and supplied encoding
`TagParser(Reader stream)` Constructor.
`TagParser(TagParserTokenManager tm)` Constructor with generated Token Manager.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `attribute(Map<String,AttrValue> alist)`
`Map<String,AttrValue>` `attributeList()`
`Comment` `commentHtmlElement()`
`HtmlElement` `decltag()`
`void` `disable_tracing()` Disable tracing.
`HtmlElement` `element()`
`void` `enable_tracing()` Enable tracing.
`HtmlElement` `endHtmlElement()`
`ParseException` `generateParseException()` Generate ParseException.
`Token` `getNextToken()` Get the next Token.
`Token` `getToken(int index)` Get the specific Token.
`void` `ReInit(InputStream stream)` Reinitialise.
`void` `ReInit(InputStream stream, String encoding)` Reinitialise.
`void` `ReInit(Reader stream)` Reinitialise.
`void` `ReInit(TagParserTokenManager tm)` Reinitialise.
`HtmlElement` `tag()`

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

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

### Field Detail

#### token_source

    public TagParserTokenManager token_source

Generated Token Manager.

#### token

    public Token token

Current token.

#### jj_nt

    public Token jj_nt

Next token.

### Constructor Detail

#### TagParser

    public TagParser(InputStream stream)

Constructor with InputStream.

#### TagParser

    public TagParser(InputStream stream,
                     String encoding)

Constructor with InputStream and supplied encoding

#### TagParser

    public TagParser(Reader stream)

Constructor.

#### TagParser

    public TagParser(TagParserTokenManager tm)

Constructor with generated Token Manager.

### Method Detail

#### element

    public final HtmlElement element()
                              throws ParseException

Throws:
  `ParseException`

#### attribute

    public final void attribute(Map<String,AttrValue> alist)
                         throws ParseException

Throws:
  `ParseException`

#### attributeList

    public final Map<String,AttrValue> attributeList()
                                              throws ParseException

Throws:
  `ParseException`

#### tag

    public final HtmlElement tag()
                          throws ParseException

Throws:
  `ParseException`

#### endHtmlElement

    public final HtmlElement endHtmlElement()
                                     throws ParseException

Returns:
  the end of a tag
Throws:
  `ParseException`

#### commentHtmlElement

    public final Comment commentHtmlElement()
                                     throws ParseException

Throws:
  `ParseException`

#### decltag

    public final HtmlElement decltag()
                              throws ParseException

Returns:
  the start of a DECLARATION
Throws:
  `ParseException`

#### ReInit

    public void ReInit(InputStream stream)

Reinitialise.

#### ReInit

    public void ReInit(InputStream stream,
                       String encoding)

Reinitialise.

#### ReInit

    public void ReInit(Reader stream)

Reinitialise.

#### ReInit

    public void ReInit(TagParserTokenManager tm)

Reinitialise.

#### getNextToken

    public final Token getNextToken()

Get the next Token.

#### getToken

    public final Token getToken(int index)

Get the specific Token.

#### generateParseException

    public ParseException generateParseException()

Generate ParseException.

#### enable_tracing

    public final void enable_tracing()

Enable tracing.

#### disable_tracing

    public final void disable_tracing()

Disable tracing.