com.opensymphony.module.sitemesh.html
Interface Tag

All Known Implementing Classes:
Parser

public interface Tag

Tag returned by HTMLTagTokenizer. Allows easy access to element name and attributes.

Author:
Joe Walnes
See Also:
TokenHandler, TagTokenizer

Field Summary
static int CLOSE
           
static int CLOSE_MAGIC_COMMENT
           
static int EMPTY
           
static int OPEN
           
static int OPEN_MAGIC_COMMENT
           
 
Method Summary
 int getAttributeCount()
           
 String getAttributeName(int index)
           
 String getAttributeValue(int index)
           
 String getAttributeValue(String name)
           
 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> - Type.OPEN
</blah> - Type.CLOSE
<blah/> - Type.EMPTY
 boolean hasAttribute(String name)
           
 void writeTo(CharArray out)
          Write out the complete tag in its original form, preserving original formatting.
 

Field Detail

OPEN

public static final int OPEN
See Also:
Constant Field Values

CLOSE

public static final int CLOSE
See Also:
Constant Field Values

EMPTY

public static final int EMPTY
See Also:
Constant Field Values

OPEN_MAGIC_COMMENT

public static final int OPEN_MAGIC_COMMENT
See Also:
Constant Field Values

CLOSE_MAGIC_COMMENT

public static final int CLOSE_MAGIC_COMMENT
See Also:
Constant Field Values
Method Detail

getContents

public String getContents()
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.

See Also:
writeTo(com.opensymphony.module.sitemesh.html.util.CharArray)

writeTo

public void writeTo(CharArray out)
Write out the complete tag in its original form, preserving original formatting.


getName

public String getName()
Name of tag (ie. element name).


getType

public int getType()
Type of tag:
<blah> - Type.OPEN
</blah> - Type.CLOSE
<blah/> - Type.EMPTY


getAttributeCount

public int getAttributeCount()

getAttributeName

public String getAttributeName(int index)

getAttributeValue

public String getAttributeValue(int index)

getAttributeValue

public String getAttributeValue(String name)

hasAttribute

public boolean hasAttribute(String name)

www.opensymphony.com/sitemesh/