org.mycore.datamodel.metadata
Class MCRMetaLinkID

java.lang.Object
  extended by org.mycore.datamodel.metadata.MCRMetaDefault
      extended by org.mycore.datamodel.metadata.MCRMetaLink
          extended by org.mycore.datamodel.metadata.MCRMetaLinkID
All Implemented Interfaces:
Cloneable, MCRMetaInterface

public final 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: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
Author:
Jens Kupferschmidt

Field Summary
 
Fields inherited from class org.mycore.datamodel.metadata.MCRMetaLink
from, href, label, linktype, MAX_XLINK_FROM_LENGTH, MAX_XLINK_HREF_LENGTH, MAX_XLINK_LABEL_LENGTH, MAX_XLINK_TITLE_LENGTH, MAX_XLINK_TO_LENGTH, MAX_XLINK_TYPE_LENGTH, title, to
 
Fields inherited from class org.mycore.datamodel.metadata.MCRMetaDefault
datapart, DEFAULT_DATAPART, DEFAULT_INHERITED, DEFAULT_LANG_LENGTH, DEFAULT_LANGUAGE, DEFAULT_STRING_LENGTH, DEFAULT_TYPE_LENGTH, inherited, lang, LOGGER, NL, subtag, type
 
Constructor Summary
MCRMetaLinkID()
          This is the constructor.
MCRMetaLinkID(String set_datapart, String set_subtag, String default_lang, int set_inherted)
          This is the constructor.
 
Method Summary
 MCRObjectID getXLinkFromID()
          This method get the xlink:from element as MCRObjectID.
 MCRObjectID getXLinkHrefID()
          This method get the xlink:href element as MCRObjectID.
 MCRObjectID getXLinkToID()
          This method get the xlink:to element as MCRObjectID.
 void setBiLink(MCRObjectID set_from, MCRObjectID set_to, String set_title)
          This method set a bidirectional link with xlink:from, xlink:to and xlink:title.
 void setBiLink(String set_from, String set_to, String set_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.
 void setReference(MCRObjectID set_href, String set_label, String set_title)
          This method set a reference with xlink:href, xlink:label and xlink:title.
 void setReference(String set_href, String set_label, String set_title)
          This method set a reference with xlink:href, xlink:label and xlink:title.
 
Methods inherited from class org.mycore.datamodel.metadata.MCRMetaLink
clone, compare, createXML, debug, getXLinkFrom, getXLinkHref, getXLinkLabel, getXLinkTitle, getXLinkTo, getXLinkType, isValid, setXLinkLabel, setXLinkTitle
 
Methods inherited from class org.mycore.datamodel.metadata.MCRMetaDefault
debugDefault, decrementInherited, getDataPart, getInherited, getInheritedToString, getLang, getSubTag, getType, incrementInherited, setDataPart, setInherited, setLang, setSubTag, setType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCRMetaLinkID

public MCRMetaLinkID()
This is the constructor.
The language element was set to en . All other elemnts was set to an empty value.


MCRMetaLinkID

public MCRMetaLinkID(String set_datapart,
                     String set_subtag,
                     String default_lang,
                     int set_inherted)
              throws MCRException
This is the constructor.
The language element was set. If the value of default_lang is null, empty or false en was set. The subtag element was set to the value of set_subtag. If the value of set_subtag is null or empty an exception was throwed.

Parameters:
set_datapart - the global part of the elements like 'metadata' or 'service' or so
set_subtag - the name of the subtag
default_lang - the default language
set_inherted - a value >= 0
Throws:
MCRException - if the set_datapart or set_subtag value is null or empty
Method Detail

setReference

public final void setReference(String set_href,
                               String set_label,
                               String set_title)
                        throws MCRException
This method set a reference with xlink:href, xlink:label and xlink:title.

Overrides:
setReference in class MCRMetaLink
Parameters:
set_href - the reference as MCRObjectID string
set_label - the new label string
set_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 set_href,
                               String set_label,
                               String set_title)
                        throws MCRException
This method set a reference with xlink:href, xlink:label and xlink:title.

Parameters:
set_href - the reference as MCRObjectID
set_label - the new label string
set_title - the new title string
Throws:
MCRException - if the set_href value is null, empty or not a MCRObjectID

setBiLink

public final void setBiLink(String set_from,
                            String set_to,
                            String set_title)
                     throws MCRException
This method set a bidirectional link with xlink:from, xlink:to and xlink:title.

Overrides:
setBiLink in class MCRMetaLink
Parameters:
set_from - the source MCRObjectID string
set_to - the target MCRObjectID string
set_title - the new title string
Throws:
MCRException - if the from or to element is not a MCRObjectId

setBiLink

public final void setBiLink(MCRObjectID set_from,
                            MCRObjectID set_to,
                            String set_title)
                     throws MCRException
This method set a bidirectional link with xlink:from, xlink:to and xlink:title.

Parameters:
set_from - the source MCRObjectID
set_to - the target MCRObjectID
set_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 final 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