org.sitemesh.tagprocessor
Class TagTokenizer.ReusableToken

java.lang.Object
  extended by org.sitemesh.tagprocessor.TagTokenizer.ReusableToken
All Implemented Interfaces:
Tag
Enclosing class:
TagTokenizer

public class TagTokenizer.ReusableToken
extends Object
implements Tag


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sitemesh.tagprocessor.Tag
Tag.Type
 
Field Summary
 int attributeCount
           
 String[] attributes
           
 
Constructor Summary
TagTokenizer.ReusableToken()
           
 
Method Summary
 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 getName()
          Name of tag (ie.
 Tag.Type getType()
          Type of tag (e.g.
 boolean hasAttribute(String name, boolean caseSensitive)
          Determine if an attribute is present.
 String toString()
          Get the complete tag in its original form, preserving original formatting.
 void writeTo(Appendable 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, wait, wait, wait
 

Field Detail

attributeCount

public int attributeCount

attributes

public String[] attributes
Constructor Detail

TagTokenizer.ReusableToken

public TagTokenizer.ReusableToken()
Method Detail

getName

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

Specified by:
getName in interface Tag

getType

public Tag.Type getType()
Description copied from interface: Tag
Type of tag (e.g. open, close, etc).

Specified by:
getType in interface Tag
See Also:
Tag.Type

writeTo

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

Specified by:
writeTo in interface Tag
Throws:
IOException

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

toString

public String toString()
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:
toString in interface Tag
Overrides:
toString in class Object
See Also:
Tag.writeTo(Appendable)


Copyright © 2011. All Rights Reserved.