Class XLink

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  XLink.Actuate
      Communicates the desired timing of traversal from the starting resource to the ending resource.
      static class  XLink.Show
      Communicates the desired presentation of the ending resource on traversal from the starting resource.
      static class  XLink.Type
      The type of a xlink.
    • Constructor Summary

      Constructors 
      Constructor Description
      XLink()
      Creates a new link.
      XLink​(XLink link)
      Creates a new link as a copy of the given link.
    • Constructor Detail

      • XLink

        public XLink()
        Creates a new link. The initial value of all attributes is null.
      • XLink

        public XLink​(XLink link)
        Creates a new link as a copy of the given link.
        Parameters:
        link - The link to copy, or null if none.
    • Method Detail

      • getType

        public XLink.Type getType()
        Returns the type of link. May have one of the following values:
        • simple: a simple link
        • extended: an extended, possibly multi-resource, link
        • locator: a pointer to an external resource
        • resource: an internal resource
        • arc: a traversal rule between resources
        • title: a descriptive title for another linking element
        The default value is null. If the set­Type(XLink​.Type) method has been invoked with the AUTO enum, then this method will infer a type from the attributes having a non-null value.
        Returns:
        the type of link, or null.
      • setType

        public void setType​(XLink.Type type)
        Sets the type of link. Any value different than Type​.AUTO (including null) will overwrite the value inferred automatically by get­Type(). A AUTO value will enable automatic type detection.
        Parameters:
        type - the new type of link, or null if none.
      • getHRef

        public URI getHRef()
        Returns a URN to an external resources, or to an other part of a XML document, or an identifier.
        Returns:
        a URN to a resources, or null if none.
      • getRole

        public URI getRole()
        Returns a URI reference for some description of the arc role.
        Returns:
        a URI reference for some description of the arc role, or null if none.
      • getArcRole

        public URI getArcRole()
        Returns a URI reference for some description of the arc role.
        Returns:
        a URI reference for some description of the arc role, or null if none.
      • getTitle

        public InternationalString getTitle()
        Returns a human-readable string with a short description for the arc.
        Returns:
        a human-readable string with a short description for the arc, or null if none.
      • getShow

        public XLink.Show getShow()
        Returns the desired presentation of the ending resource on traversal from the starting resource. It's value should be treated as follows:
        • new: load ending resource in a new window, frame, pane, or other presentation context
        • replace: load the resource in the same window, frame, pane, or other presentation context
        • embed: load ending resource in place of the presentation of the starting resource
        • other: behavior is unconstrained; examine other markup in the link for hints
        • none: behavior is unconstrained
        Returns:
        the desired presentation of the ending resource, or null if unspecified.
      • getActuate

        public XLink.Actuate getActuate()
        Returns the desired timing of traversal from the starting resource to the ending resource. It's value should be treated as follows:
        • onLoad: traverse to the ending resource immediately on loading the starting resource
        • onRequest: traverse from the starting resource to the ending resource only on a post-loading event triggered for this purpose
        • other: behavior is unconstrained; examine other markup in link for hints
        • none: behavior is unconstrained
        Returns:
        the desired timing of traversal from the starting resource to the ending resource, or null if unspecified.
      • getLabel

        public String getLabel()
        Returns an identification of the target of a from or to attribute.
        Returns:
        an identification of the target of a from or to attribute, or null.
      • getFrom

        public String getFrom()
        Returns the starting resource. The value must correspond to the same value for some label attribute.
        Returns:
        the starting resource, or null.
      • getTo

        public String getTo()
        Returns the ending resource. The value must correspond to the same value for some label attribute.
        Returns:
        the ending resource, or null.
      • freeze

        public void freeze()
        Marks this xlink as unmodifiable. After this method call, any call to a setter method will throw an Unsupported­Operation­Exception.

        After the first call to this method, any subsequent calls have no effect.

      • equals

        public boolean equals​(Object object)
        Compares this XLink with the given object for equality.
        Overrides:
        equals in class Object
        Parameters:
        object - the object to compare with this XLink.
      • hashCode

        public int hashCode()
        Returns a hash code value for this XLink.
        Overrides:
        hash­Code in class Object
      • toString

        public String toString()
        Returns a string representation of this object. The default implementation returns the simple class name followed by non-null attributes, as in the example below:
        XLink[type="locator", href="urn:ogc:def:method:EPSG::4326"]
        Overrides:
        to­String in class Object