Methods Summary |
---|
TraitAnim | createTraitAnimImpl(java.lang.String traitName)
if (SVGConstants.SVG_TARGET_ATTRIBUTE == traitName) {
return new StringTraitAnim(this, NULL_NS, traitName);
} else {
return super.createTraitAnimImpl(traitName);
}
|
TraitAnim | createTraitAnimNSImpl(java.lang.String traitNamespace, java.lang.String traitName)
if (traitNamespace == SVGConstants.XLINK_NAMESPACE_URI
&&
traitName == SVGConstants.SVG_HREF_ATTRIBUTE) {
return new StringTraitAnim(this, traitNamespace, traitName);
}
return super.createTraitAnimNSImpl(traitNamespace, traitName);
|
public java.lang.String | getHref()This returns the absolute URI, even though
the href may have been a relative URI
String uriBase = getURIBase();
String docBase = ownerDocument.getURIBase();
if (uriBase != null
&& uriBase.equals(docBase)
&& href != null
&& href.length() > 0
&& href.charAt(0) == '#") {
// IMPORTANT: this prevents prepending the document URI
// to a relative URI if the reference is a local one.
// See:
// http://www.ietf.org/rfc/rfc2396.txt
// Paragraph 4.2 Same-Document References.
uriBase = null;
}
try {
if (uriBase != null) {
return URLResolver.resolve(uriBase, href);
} else {
return href;
}
} catch (IllegalArgumentException iae) {
return null;
}
|
public java.lang.String | getLocalName()
return SVGConstants.SVG_A_TAG;
|
public java.lang.String | getTarget()
return target;
|
public java.lang.String | getTraitImpl(java.lang.String name)Anchor handles the target trait.
if (SVGConstants.SVG_TARGET_ATTRIBUTE == name) {
return getTarget();
} else {
return super.getTraitImpl(name);
}
|
java.lang.String | getTraitNSImpl(java.lang.String namespaceURI, java.lang.String name)Anchor handles the xlink:href attribute
if (SVGConstants.XLINK_NAMESPACE_URI == namespaceURI
&&
SVGConstants.SVG_HREF_ATTRIBUTE == name) {
String res = getHref();
if (res == null) {
res = href;
}
return res;
} else {
return super.getTraitNSImpl(namespaceURI, name);
}
|
public ElementNode | newInstance(DocumentNode doc)Used by DocumentNode to create a new instance from
a prototype AnchorNode .
return new Anchor(doc);
|
public void | setHref(java.lang.String href)
if (href == null) {
throw new IllegalArgumentException();
}
if (href.equals(this.href)) {
return;
}
modifyingNode();
this.href = href;
modifiedNode();
|
public void | setTarget(java.lang.String target)
if (target == null) {
throw new IllegalArgumentException();
}
if (target.equals(this.target)) {
return;
}
modifyingNode();
this.target = target;
modifiedNode();
|
public void | setTraitImpl(java.lang.String name, java.lang.String value)Anchor handles the target trait.
if (SVGConstants.SVG_TARGET_ATTRIBUTE == name) {
if (value == null) {
throw illegalTraitValue(name, value);
}
setTarget(value);
} else {
super.setTraitImpl(name, value);
}
|
public void | setTraitNSImpl(java.lang.String namespaceURI, java.lang.String name, java.lang.String value)Anchor supports the xlink:href trait.
try {
if (SVGConstants.XLINK_NAMESPACE_URI == namespaceURI
&&
SVGConstants.SVG_HREF_ATTRIBUTE == name) {
setHref(value);
} else {
super.setTraitNSImpl(namespaceURI, name, value);
}
} catch (IllegalArgumentException iae) {
throw new DOMException(DOMException.INVALID_ACCESS_ERR,
iae.getMessage());
}
|
boolean | supportsTrait(java.lang.String traitName)Anchor handles the target trait.
if (SVGConstants.SVG_TARGET_ATTRIBUTE == traitName) {
return true;
} else {
return super.supportsTrait(traitName);
}
|
boolean | supportsTraitNS(java.lang.String namespaceURI, java.lang.String traitName)Supported traits: xlink:href
if (SVGConstants.XLINK_NAMESPACE_URI == namespaceURI
&&
SVGConstants.SVG_HREF_ATTRIBUTE == traitName) {
return true;
} else {
return super.supportsTraitNS(namespaceURI, traitName);
}
|
public java.lang.String | toString()
return "Anchor[href=(" + href + ") absolute href=(" + getHref() + ")]";
|