Class MCRMetaDerivateLink

All Implemented Interfaces:
Cloneable, MCRMetaInterface

public class MCRMetaDerivateLink extends MCRMetaLink
  • Constructor Details

    • MCRMetaDerivateLink

      public MCRMetaDerivateLink()
      Constructor initializes the HashMap
  • Method Details

    • setLinkToFile

      public void setLinkToFile(MCRPath file)
    • setFromDOM

      public void setFromDOM(Element element) throws MCRException
      Description copied from class: MCRMetaLink
      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 null or empty
    • createXML

      public Element createXML() throws MCRException
      Description copied from class: MCRMetaLink
      This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaLink definition for the given subtag.
      Specified by:
      createXML in interface MCRMetaInterface
      Overrides:
      createXML in class MCRMetaLink
      Returns:
      a JDOM Element with the XML MCRMetaLink part
      Throws:
      MCRException - if the content of this class is not valid
    • getOwner

      public String getOwner()
      Returns the owner of this derivate link. In most cases this is the derivate id itself.
      Returns:
      the owner of this derivate link.
    • getPath

      public String getPath() throws URISyntaxException
      Returns the URI decoded path of this derivate link. Use getRawPath() if you want the URI encoded path.
      Returns:
      path of this derivate link
      Throws:
      URISyntaxException - the path couldn't be decoded
    • getRawPath

      public String getRawPath()
      Returns the raw path of this derivate link. Be aware that this path is URI encoded. Use getPath() if you want the URI decoded path.
      Returns:
      URI encoded path
    • getLinkedFile

      public MCRPath getLinkedFile() throws URISyntaxException
      Returns the MCRPath to this derivate link.
      Returns:
      path to this derivate link
      Throws:
      URISyntaxException - the path part of this derivate link couldn't be decoded because its an invalid URI
    • validate

      public void validate() throws MCRException
      Validates this MCRMetaDerivateLink. This method throws an exception if:
      • the subtag is not null or empty
      • the lang value was supported
      • the inherited value is lower than zero
      • the linked files is null or does not exist
      Specified by:
      validate in interface MCRMetaInterface
      Overrides:
      validate in class MCRMetaLink
      Throws:
      MCRException - the MCRMetaDerivateLink is invalid
    • clone

      public MCRMetaDerivateLink 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: