|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.mylar.internal.monitor.usage.HtmlTag
public class HtmlTag
Class representing an HTML (3.2) tag and its attributes.
Nested Class Summary | |
---|---|
static class |
HtmlTag.Type
Enum class for tag types. |
Field Summary | |
---|---|
private java.util.HashMap<java.lang.String,java.lang.String> |
attributes
tag's attributes (keys are lowercase attribute names) |
private java.net.URL |
baseUrl
tag's base url |
private boolean |
isEndTag
true if the tag is a closing tag |
private java.lang.String |
tagName
tag's name |
private static java.util.HashMap<java.lang.String,javax.swing.text.html.HTML.Tag> |
tags
|
private javax.swing.text.html.HTML.Tag |
tagType
tag type enum |
Constructor Summary | |
---|---|
HtmlTag()
Basic constructor. |
|
HtmlTag(HtmlTag htmltag)
Copy constructor. |
|
HtmlTag(java.lang.String s)
Constructor. |
|
HtmlTag(java.net.URL url)
Constructor creating an otherwise empty tag, but with a given base url. |
Method Summary | |
---|---|
java.lang.String |
getAttribute(java.lang.String s)
Returns the value of a tag's attribute, or NULL if it doesn't exist. |
int |
getIntAttribute(java.lang.String s)
Returns the value of a tag's attribute as an integer. |
java.lang.String |
getTagName()
Returns the tag's name (e.g., "HEAD", "P", etc.). |
javax.swing.text.html.HTML.Tag |
getTagType()
Returns the tag's type (linked to the tag's name). |
java.lang.StringBuffer |
getURLs()
|
boolean |
hasAttribute(java.lang.String s)
Returns true if the tag contains attribute with the given
name. |
boolean |
isEndTag()
Returns true if the tag is a closing tag. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Sets the value of a tag's attribute. |
void |
setTagName(java.lang.String s)
Sets the tag's name and type, if known. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String tagName
private javax.swing.text.html.HTML.Tag tagType
private boolean isEndTag
private java.util.HashMap<java.lang.String,java.lang.String> attributes
private java.net.URL baseUrl
private static java.util.HashMap<java.lang.String,javax.swing.text.html.HTML.Tag> tags
Constructor Detail |
---|
public HtmlTag()
public HtmlTag(HtmlTag htmltag)
public HtmlTag(java.lang.String s) throws java.text.ParseException
java.text.ParseException
public HtmlTag(java.net.URL url)
Method Detail |
---|
public javax.swing.text.html.HTML.Tag getTagType()
public java.lang.String getTagName()
public void setTagName(java.lang.String s) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the argument is null
or empty stringpublic boolean isEndTag()
true
if the tag is a closing tag.
public int getIntAttribute(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public java.lang.String getAttribute(java.lang.String s)
public boolean hasAttribute(java.lang.String s)
true
if the tag contains attribute with the given
name.
public void setAttribute(java.lang.String name, java.lang.String value)
public java.lang.StringBuffer getURLs()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |