Package org.mycore.datamodel.metadata
Class MCRMetaLinkID
java.lang.Object
org.mycore.datamodel.metadata.MCRMetaDefault
org.mycore.datamodel.metadata.MCRMetaLink
org.mycore.datamodel.metadata.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
-
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
ConstructorsConstructorDescriptioninitializes with empty values.MCRMetaLinkID
(String subtag, int inherted) initializes with given values.MCRMetaLinkID
(String subtag, MCRObjectID id, String label, String title) initializes with all values needed to link to an MCRObject.MCRMetaLinkID
(String subtag, MCRObjectID id, String label, String title, String role) initializes with all values needed to link to an MCRObject. -
Method Summary
Modifier and TypeMethodDescriptionclone()
clone of this instance you will get a (deep) clone of this elementboolean
final MCRObjectID
This method get the xlink:from element as MCRObjectID.final MCRObjectID
This method get the xlink:href element as MCRObjectID.final MCRObjectID
This method get the xlink:to element as MCRObjectID.final void
This method set a bidirectional link with xlink:from, xlink:to and xlink:title.final void
setBiLink
(MCRObjectID from, MCRObjectID to, String title) This method set a bidirectional link with xlink:from, xlink:to and xlink:title.void
setFromDOM
(Element element) This method read the XML input stream part from a DOM part for the metadata of the document.final void
setReference
(String href, String label, String title) This method set a reference with xlink:href, xlink:label and xlink:title.final void
setReference
(MCRObjectID href, String label, String title) This method set a reference with xlink:href, xlink:label and xlink:title.final String
toString()
Methods inherited from class org.mycore.datamodel.metadata.MCRMetaLink
compare, createJSON, createXML, debug, getXLinkFrom, getXLinkHref, getXLinkLabel, getXLinkRole, getXLinkTitle, getXLinkTo, getXLinkType, hashCode, setXLinkLabel, setXLinkRole, setXLinkTitle, validate
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
-
MCRMetaLinkID
public MCRMetaLinkID()initializes with empty values. -
MCRMetaLinkID
initializes with given values.- See Also:
-
MCRMetaLinkID
initializes with all values needed to link to an MCRObject. This is the same as runningMCRMetaLinkID(String, int)
andsetReference(MCRObjectID, String, String)
. -
MCRMetaLinkID
initializes with all values needed to link to an MCRObject.
-
-
Method Details
-
setReference
This method set a reference with xlink:href, xlink:label and xlink:title.- Overrides:
setReference
in classMCRMetaLink
- Parameters:
href
- the reference as MCRObjectID stringlabel
- the new label stringtitle
- the new title string- Throws:
MCRException
- if the set_href value is null, empty or not a MCRObjectID
-
setReference
This method set a reference with xlink:href, xlink:label and xlink:title.- Parameters:
href
- the reference as MCRObjectIDlabel
- the new label stringtitle
- the new title string- Throws:
MCRException
- if the href value is null, empty or not a MCRObjectID
-
setBiLink
This method set a bidirectional link with xlink:from, xlink:to and xlink:title.- Overrides:
setBiLink
in classMCRMetaLink
- Parameters:
from
- the source MCRObjectID stringto
- the target MCRObjectID stringtitle
- the new title string- Throws:
MCRException
- if the from or to element is not a MCRObjectId
-
setBiLink
This method set a bidirectional link with xlink:from, xlink:to and xlink:title.- Parameters:
from
- the source MCRObjectIDto
- the target MCRObjectIDtitle
- the new title string- Throws:
MCRException
- if the from or to element is not a MCRObjectId
-
getXLinkHrefID
This method get the xlink:href element as MCRObjectID.- Returns:
- the xlink:href element as MCRObjectID
-
getXLinkFromID
This method get the xlink:from element as MCRObjectID.- Returns:
- the xlink:from element as MCRObjectID
-
getXLinkToID
This method get the xlink:to element as MCRObjectID.- Returns:
- the xlink:to element as MCRObjectID
-
setFromDOM
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 not a MCRObjectID
-
equals
- Overrides:
equals
in classMCRMetaLink
-
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:
-
toString
-