getHTMLAttribute(String name, String defaultValue) Get an HTML attribute's value, with a default value if it doesn't exist.
Parameters: name - Name of HTML attribute (e.g.
public Tag(Page page, int start, int end, String tagName, boolean startTag)(Code)
Make a Tag.
Parameters: page - Page containing tag Parameters: start - Starting offset of tag in page Parameters: end - Ending offset of tag Parameters: tagName - Name of tag (like "p") Parameters: startTag - true for start tags (like "<p>"), false for end tags ("</p>")
Get an HTML attribute's value.
Parameters: name - Name of HTML attribute (e.g. "HREF"). Doesn't have to beconverted with toHTMLAttributeName(). value of attribute if it exists, TRUE if the attribute exists but has no value, or null if tag lacks the attribute.
Get an HTML attribute's value, with a default value if it doesn't exist.
Parameters: name - Name of HTML attribute (e.g. "HREF"). Doesn't have to beconverted with toHTMLAttributeName(). Parameters: defaultValue - default value to return if the attribute doesn't exist value of attribute if it exists, TRUE if the attribute exists but has no value, or defaultValue if tag lacks the attribute.
Get all the HTML attributes found on this tag.
array of name-value pairs, alternating between names and values. Thus array[0] is a name, array[1] is a value,array[2] is a name, etc.
Get tag name.
tag name (like "p"), in lower-case, String.intern()'ed form.
hasHTMLAttribute
public boolean hasHTMLAttribute(String name)(Code)
Test if tag has an HTML attribute.
Parameters: name - Name of HTML attribute (e.g. "HREF"). Doesn't have to beconverted with toHTMLAttributeName(). true if tag has the attribute, false if not
Copy this tag, removing an HTML attribute.
Parameters: name - Name of HTML attribute (e.g. "HREF"). Doesn't have to beconverted with toHTMLAttributeName(). copy of this tag with named attribute removed. The copy is a region of a fresh page containing only the tag.
Copy this tag, setting an HTML attribute's value to TRUE.
Parameters: name - Name of HTML attribute (e.g. "HREF"). Doesn't have to beconverted with toHTMLAttributeName(). copy of this tag with named attribute set to TRUE. The copy is a region of a fresh page containing only the tag.
Copy this tag, setting an HTML attribute's value.
Parameters: name - Name of HTML attribute (e.g. "HREF"). Doesn't have to beconverted with toHTMLAttributeName(). Parameters: value - New value for the attribute copy of this tag with named attribute set to value. The copy is a region of a fresh page containing only the tag.
Convert a String to an HTML attribute name. Attribute names are
lower-case, intern()'ed
Strings. Thus you can compare attribute names with ==.
Parameters: name - Name to convert (e.g., "HREF") tag name (e.g. "href"), in lower-case, String.intern()'ed form.
Convert a String to a tag name. Tag names are lower-case, intern()'ed
Strings. Thus you can compare tag names with ==, as in:
getTagName() == Tag.IMG.
Parameters: name - Name to convert (e.g., "P") tag name (e.g. "p"), in lower-case, String.intern()'ed form.