Class MCRMetaLinkID

All Implemented Interfaces:
Cloneable, MCRMetaInterface
Direct Known Subclasses:
MCRMetaEnrichedLinkID

@JsonClassDescription("Links to other objects or derivates") public class MCRMetaLinkID extends MCRMetaLink
This class implements all method for special handling with the MCRMetaLink part of a metadata object. The MCRMetaLinkID class present two types. At once a reference only of a other MCRObject. At second a bidirectional link between two MCRObject's. Optional you can append the reference with the label attribute. See to W3C XLink Standard for more informations.

<tag class="MCRMetaLinkID">
<subtag xlink:type="locator" xlink:href=" MCRObjectID" xlink:label="..." xlink:title="..."/>
<subtag xlink:type="arc" xlink:from=" MCRObjectID" xlink:to="MCRObjectID"/>
</tag>

Version:
$Revision$ $Date$
Author:
Jens Kupferschmidt
  • Constructor Details

  • Method Details

    • setReference

      public final void setReference(String href, String label, String title) throws MCRException
      This method set a reference with xlink:href, xlink:label and xlink:title.
      Overrides:
      setReference in class MCRMetaLink
      Parameters:
      href - the reference as MCRObjectID string
      label - the new label string
      title - the new title string
      Throws:
      MCRException - if the set_href value is null, empty or not a MCRObjectID
    • setReference

      public final void setReference(MCRObjectID href, String label, String title) throws MCRException
      This method set a reference with xlink:href, xlink:label and xlink:title.
      Parameters:
      href - the reference as MCRObjectID
      label - the new label string
      title - the new title string
      Throws:
      MCRException - if the href value is null, empty or not a MCRObjectID
    • setBiLink

      public final void setBiLink(String from, String to, String title) throws MCRException
      This method set a bidirectional link with xlink:from, xlink:to and xlink:title.
      Overrides:
      setBiLink in class MCRMetaLink
      Parameters:
      from - the source MCRObjectID string
      to - the target MCRObjectID string
      title - the new title string
      Throws:
      MCRException - if the from or to element is not a MCRObjectId
    • setBiLink

      public final void setBiLink(MCRObjectID from, MCRObjectID to, String title) throws MCRException
      This method set a bidirectional link with xlink:from, xlink:to and xlink:title.
      Parameters:
      from - the source MCRObjectID
      to - the target MCRObjectID
      title - the new title string
      Throws:
      MCRException - if the from or to element is not a MCRObjectId
    • getXLinkHrefID

      public final MCRObjectID getXLinkHrefID()
      This method get the xlink:href element as MCRObjectID.
      Returns:
      the xlink:href element as MCRObjectID
    • getXLinkFromID

      public final MCRObjectID getXLinkFromID()
      This method get the xlink:from element as MCRObjectID.
      Returns:
      the xlink:from element as MCRObjectID
    • getXLinkToID

      public final MCRObjectID getXLinkToID()
      This method get the xlink:to element as MCRObjectID.
      Returns:
      the xlink:to element as MCRObjectID
    • setFromDOM

      public void setFromDOM(Element element)
      This method read the XML input stream part from a DOM part for the metadata of the document.
      Specified by:
      setFromDOM in interface MCRMetaInterface
      Overrides:
      setFromDOM in class MCRMetaLink
      Parameters:
      element - a relevant DOM element for the metadata
      Throws:
      MCRException - if the xlink:type is not locator or arc or if href or from and to are not a MCRObjectID
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class MCRMetaLink
    • clone

      public MCRMetaLinkID clone()
      Description copied from class: MCRMetaLink
      clone of this instance you will get a (deep) clone of this element
      Specified by:
      clone in interface MCRMetaInterface
      Overrides:
      clone in class MCRMetaLink
      See Also:
    • toString

      public final String toString()
      Overrides:
      toString in class Object