|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.html.HtmlElement edu.nrao.sss.html.HtmlAnchor
public class HtmlAnchor
An HTML anchor (HTML.Tag.A
).
Version Info:
$Revision: 1360 $ |
$Date: 2008-06-19 14:08:48 -0600 (Thu, 19 Jun 2008) $ |
$Author: dharland $ |
Field Summary |
---|
Fields inherited from class edu.nrao.sss.html.HtmlElement |
---|
NBSP_HTML, NBSP_TEXT, NBSP_UNICODE |
Constructor Summary | |
---|---|
HtmlAnchor()
Creates a new, unnamed, empty anchor. |
|
HtmlAnchor(String name,
String href,
String display)
Creates a new HTML anchor with the given properties. |
Method Summary | |
---|---|
String |
getDisplayText()
Returns the text to display for this anchor. |
String |
getName()
Returns the name of this anchor, if any. |
String |
getUrlText()
Returns the HREF value for this anchor, if any. |
boolean |
hasName()
Returns true if this anchor has a non-null value for the HTML.Attribute.NAME type. |
boolean |
hasUrlText()
Return true if this anchor has a non-null value for the HTML.Attribute.HREF type. |
boolean |
isSimple()
Returns true if this is a simple element. |
static HtmlAnchor |
parse(String anchorTag)
Creates and returns a new HTML anchor by parsing anchorTag . |
void |
setDisplayText(String text)
Sets the text to display for this anchor. |
Methods inherited from class edu.nrao.sss.html.HtmlElement |
---|
addAttribute, copyAttributesOf, getAttribute, getAttributes, getAttributeValue, getTag, removeAllAttributes, removeAttribute, writeHtmlTo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlAnchor()
public HtmlAnchor(String name, String href, String display)
<a name="name" href="href">display</a>
name
- the name of this anchor.
If this parameter is null, this anchor will have
no name.href
- the HTML link associated with this anchor.
If this parameter is null, this anchor will have
no link.display
- the text displayed on an HTML page for this anchor.
If this parameter is null, it will be converted
to the empty string ("").Method Detail |
---|
public static HtmlAnchor parse(String anchorTag)
anchorTag
.
anchorTag
- the HTML form of this anchor.
The expected form of the text is:
<a name="name" href='absolute or relative URL'>display text</a>The anchor name can be "a" or "A"; you may even mix the capitalization in a single tag (<A ...>...</a>). Values may be quoted with either single (') or double (") quotes. Leading and trailing whitespace is permitted and will be trimmed during parsing.
anchorTag
.
IllegalArgumentException
- if anything goes wrong during parsing.public boolean isSimple()
HtmlElement
isSimple
in class HtmlElement
public void setDisplayText(String text)
text
- the text to display for this anchor. If this
parameter is null, it will be replaced by the
empty string ("").public String getDisplayText()
public boolean hasName()
public String getName()
public boolean hasUrlText()
public String getUrlText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |