Class XLink

java.lang.Object
  |
  +--XLink

public class XLink
extends java.lang.Object

Models an XLink (vide http://www.w3c.org/XML/Linking) locator. N.B. that this class neither aims at nor achieves full compliance with the W3C recommendation.

Version:
$2006-08-24 06:28:03 mdh$
Author:
Malcolm D. Hyman

Constructor Summary
XLink()
           
XLink(org.w3c.dom.Element e)
           
XLink(org.w3c.dom.Node n)
           
XLink(java.lang.String href)
           
XLink(java.lang.String href, int show)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDocumentPart()
          Returns the document part of an XPTR URI.
 java.lang.String getFragmentPart()
          Returns the fragment identifier part of an XPTR URI.
 java.lang.String getHREF()
          Returns the HREF.
 org.w3c.dom.Node getNode()
          Returns the node pointed to by this link, if it is an XPTR.
 TreeNodeView getTreeNodeView(ContentOwner owner)
          Returns a TreeNodeView, i.e.
 int hashCode()
           
 boolean isRelative()
          Returns true if href is a relative URI.
 boolean isVoid()
          Returns true if there is no href.
 boolean isXPTR()
          Returns true if XLink points to a fragment specified with the XPointer syntax.
 java.net.URL locate(ContentOwner owner)
          Returns a URL corresponding to the HREF of this XLink, using name resolution services, if needed.
 java.lang.Object open(ContentOwner owner)
          Opens the link target.
 java.lang.String toString()
           
 java.net.URL toURL()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XLink

public XLink()

XLink

public XLink(java.lang.String href)

XLink

public XLink(java.lang.String href,
             int show)

XLink

public XLink(org.w3c.dom.Element e)

XLink

public XLink(org.w3c.dom.Node n)
Method Detail

isXPTR

public boolean isXPTR()
Returns true if XLink points to a fragment specified with the XPointer syntax.
Returns:
true if XPointer

getDocumentPart

public java.lang.String getDocumentPart()
Returns the document part of an XPTR URI. If href is not XPTR conformant, return value is undefined.
Returns:
document part of URI

getFragmentPart

public java.lang.String getFragmentPart()
Returns the fragment identifier part of an XPTR URI. If href is not XPTR conformant, return value is undefined.
Returns:
fragment identifier part of URI

getHREF

public java.lang.String getHREF()
Returns the HREF.
Returns:
HREF

isVoid

public boolean isVoid()
Returns true if there is no href.
Returns:
true if no href

isRelative

public boolean isRelative()
Returns true if href is a relative URI.
Returns:
true if relative URI

open

public java.lang.Object open(ContentOwner owner)
Opens the link target.
Parameters:
owner - relevant (linking) ContentOwner
Returns:
object in which the target was opened

getTreeNodeView

public TreeNodeView getTreeNodeView(ContentOwner owner)
Returns a TreeNodeView, i.e. a tuple consisting of an ArborPanel and a TreePath, that corresponds to the target of this XLink.
Parameters:
owner - the linking ContentOwner
Returns:
the appropriate TreeNodeView

getNode

public org.w3c.dom.Node getNode()
Returns the node pointed to by this link, if it is an XPTR.
Returns:
target node

locate

public java.net.URL locate(ContentOwner owner)
                    throws java.net.MalformedURLException
Returns a URL corresponding to the HREF of this XLink, using name resolution services, if needed. (The toURL() method does no name resolution.)
Parameters:
owner - the linking ContentOwner
Returns:
URL
See Also:
toURL()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toURL

public java.net.URL toURL()
                   throws java.net.MalformedURLException

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object