Package com.opensymphony.module.sitemesh.html.tokenizer

# Class Parser.ReusableToken

java.lang.Object
com.opensymphony.module.sitemesh.html.tokenizer.Parser.ReusableToken

All Implemented Interfaces:
  `Tag`, `Text`

Enclosing class:
  `Parser`

public class Parser.ReusableToken extends Object implements Tag, Text

## Field Summary

Fields
Modifier and Type
Field
Description
`int`
`attributeCount`
`String[]`
`attributes`

### Fields inherited from interface com.opensymphony.module.sitemesh.html.Tag

`CLOSE, CLOSE_MAGIC_COMMENT, EMPTY, OPEN, OPEN_MAGIC_COMMENT`

## Constructor Summary

Constructors
Constructor
Description
`ReusableToken()`

## Method Summary

Modifier and Type
Method
Description
`int`
`getAttributeCount()`
Number of attributes in tag.
`int`
`getAttributeIndex(String name, boolean caseSensitive)`
Determine which attribute has the specified name.
`String`
`getAttributeName(int index)`
Get name of attribute.
`String`
`getAttributeValue(int index)`
Get value of an attribute.
`String`
`getAttributeValue(String name, boolean caseSensitive)`
Get value of an attribute.
`String`
`getContents()`
Get the complete tag in its original form, preserving original formatting.
`String`
`getName()`
Name of tag (ie.
`int`
`getType()`
Type of tag:
<blah> - Tag.OPEN
</blah> - Tag.CLOSE
<blah/> - Tag.EMPTY
`boolean`
`hasAttribute(String name, boolean caseSensitive)`
Determine if an attribute is present.
`void`
`writeTo(CharArray out)`
Write out the complete tag in its original form, preserving original formatting.

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

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

## Field Details

### attributeCount

public int attributeCount

### attributes

public String[] attributes

## Constructor Details

### ReusableToken

public ReusableToken()

## Method Details

### getName

public String getName()
Description copied from interface: `Tag`
Name of tag (ie. element name).

Specified by:
  `getName` in interface `Tag`

### getType

public int getType()
Description copied from interface: `Tag`
Type of tag:
<blah> - Tag.OPEN
</blah> - Tag.CLOSE
<blah/> - Tag.EMPTY

Specified by:
  `getType` in interface `Tag`

### getContents

public String getContents()
Description copied from interface: `Tag`
Get the complete tag in its original form, preserving original formatting. This has a slight overhead in that it needs to construct a String. For improved performance, use writeTo() instead.

Specified by:
  `getContents` in interface `Tag`
Specified by:
  `getContents` in interface `Text`
See Also:
  - `Tag.writeTo(com.opensymphony.module.sitemesh.html.util.CharArray)`

### writeTo

public void writeTo(CharArray out)
Description copied from interface: `Tag`
Write out the complete tag in its original form, preserving original formatting.

Specified by:
  `writeTo` in interface `Tag`
Specified by:
  `writeTo` in interface `Text`

### getAttributeCount

public int getAttributeCount()
Description copied from interface: `Tag`
Number of attributes in tag.

Specified by:
  `getAttributeCount` in interface `Tag`

### getAttributeIndex

public int getAttributeIndex(String name, boolean caseSensitive)
Description copied from interface: `Tag`
Determine which attribute has the specified name.

Specified by:
  `getAttributeIndex` in interface `Tag`

### getAttributeName

public String getAttributeName(int index)
Description copied from interface: `Tag`
Get name of attribute.

Specified by:
  `getAttributeName` in interface `Tag`

### getAttributeValue

public String getAttributeValue(int index)
Description copied from interface: `Tag`
Get value of an attribute. If this is an empty attribute (i.e. just a name, without a value), null is returned.

Specified by:
  `getAttributeValue` in interface `Tag`

### getAttributeValue

public String getAttributeValue(String name, boolean caseSensitive)
Description copied from interface: `Tag`
Get value of an attribute. If this is an empty attribute (i.e. just a name, without a value), null is returned.

Specified by:
  `getAttributeValue` in interface `Tag`

### hasAttribute

public boolean hasAttribute(String name, boolean caseSensitive)
Description copied from interface: `Tag`
Determine if an attribute is present.

Specified by:
  `hasAttribute` in interface `Tag`