Package org.mycore.datamodel.metadata
Class MCRMetaDerivateLink
java.lang.Object
org.mycore.datamodel.metadata.MCRMetaDefault
org.mycore.datamodel.metadata.MCRMetaLink
org.mycore.datamodel.metadata.MCRMetaDerivateLink
- All Implemented Interfaces:
Cloneable
,MCRMetaInterface
-
Field Summary
Fields inherited from class org.mycore.datamodel.metadata.MCRMetaLink
from, href, label, linktype, role, title, to
Fields inherited from class org.mycore.datamodel.metadata.MCRMetaDefault
datapart, DEFAULT_ATTRIBUTE_INHERITED, DEFAULT_ATTRIBUTE_LANG, DEFAULT_ATTRIBUTE_SEQUENCE, DEFAULT_ATTRIBUTE_TYPE, DEFAULT_ELEMENT_DATAPART, DEFAULT_INHERITED, DEFAULT_LANG_LENGTH, DEFAULT_LANGUAGE, DEFAULT_SEQUENCE, DEFAULT_STRING_LENGTH, DEFAULT_TYPE_LENGTH, inherited, lang, NL, sequence, subtag, type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
clone of this instance you will get a (deep) clone of this elementThis method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaLink definition for the given subtag.Returns theMCRPath
to this derivate link.getOwner()
Returns the owner of this derivate link.getPath()
Returns the URI decoded path of this derivate link.Returns the raw path of this derivate link.void
setFromDOM
(Element element) This method read the XML input stream part from a DOM part for the metadata of the document.void
setLinkToFile
(MCRPath file) void
validate()
Validates this MCRMetaDerivateLink.Methods inherited from class org.mycore.datamodel.metadata.MCRMetaLink
compare, createJSON, debug, equals, getXLinkFrom, getXLinkHref, getXLinkLabel, getXLinkRole, getXLinkTitle, getXLinkTo, getXLinkType, hashCode, setBiLink, setReference, setXLinkLabel, setXLinkRole, setXLinkTitle
Methods inherited from class org.mycore.datamodel.metadata.MCRMetaDefault
debugDefault, decrementInherited, getInherited, getLang, getSequence, getSubTag, getType, incrementInherited, isValid, setInherited, setLang, setSequence, setSubTag, setType
-
Constructor Details
-
MCRMetaDerivateLink
public MCRMetaDerivateLink()Constructor initializes the HashMap
-
-
Method Details
-
setLinkToFile
-
setFromDOM
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 interfaceMCRMetaInterface
- Overrides:
setFromDOM
in classMCRMetaLink
- 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
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 interfaceMCRMetaInterface
- Overrides:
createXML
in classMCRMetaLink
- Returns:
- a JDOM Element with the XML MCRMetaLink part
- Throws:
MCRException
- if the content of this class is not valid
-
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
Returns the URI decoded path of this derivate link. UsegetRawPath()
if you want the URI encoded path.- Returns:
- path of this derivate link
- Throws:
URISyntaxException
- the path couldn't be decoded
-
getRawPath
Returns the raw path of this derivate link. Be aware that this path is URI encoded. UsegetPath()
if you want the URI decoded path.- Returns:
- URI encoded path
-
getLinkedFile
Returns theMCRPath
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
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 interfaceMCRMetaInterface
- Overrides:
validate
in classMCRMetaLink
- Throws:
MCRException
- the MCRMetaDerivateLink is invalid
-
clone
Description copied from class:MCRMetaLink
clone of this instance you will get a (deep) clone of this element- Specified by:
clone
in interfaceMCRMetaInterface
- Overrides:
clone
in classMCRMetaLink
- See Also:
-