|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.datamodel.metadata.MCRMetaDefault
org.mycore.datamodel.metadata.MCRMetaLink
public class MCRMetaLink
This class implements all method for generic handling with the MCRMetaLink part of a metadata object. The MCRMetaLink class present two types. At once a reference to an URL. At second a bidirectional link between two URL's. Optional you can append the reference with the label attribute. See to W3C XLink Standard for more informations.
<tag class="MCRMetaLink">
<subtag xlink:type="locator" xlink:href=" URL" xlink:label="..." xlink:title="..."/>
<subtag xlink:type="arc" xlink:from=" URL" xlink:to="URL"/>
</tag>
| Field Summary | |
|---|---|
protected String |
from
|
protected String |
href
|
protected String |
label
|
protected String |
linktype
|
static int |
MAX_XLINK_FROM_LENGTH
The length of XLink:from * |
static int |
MAX_XLINK_HREF_LENGTH
The length of XLink:href * |
static int |
MAX_XLINK_LABEL_LENGTH
The length of XLink:label * |
static int |
MAX_XLINK_TITLE_LENGTH
The length of XLink:title * |
static int |
MAX_XLINK_TO_LENGTH
The length of XLink:to * |
static int |
MAX_XLINK_TYPE_LENGTH
The length of XLink:type * |
protected String |
title
|
protected String |
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 | |
|---|---|
MCRMetaLink()
This is the constructor. |
|
MCRMetaLink(String set_datapart,
String set_subtag,
String default_lang,
int set_inherted)
This is the constructor. |
|
| Method Summary | |
|---|---|
Object |
clone()
This method make a clone of this class. |
boolean |
compare(MCRMetaLink input)
The methode compare this instance of MCRMetaLink with a input object of the class type MCRMetaLink. |
Element |
createXML()
This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaLink definition for the given subtag. |
void |
debug()
This method put debug data to the logger (for the debug mode). |
String |
getXLinkFrom()
This method get the xlink:from element as string. |
String |
getXLinkHref()
This method get the xlink:href element as string. |
String |
getXLinkLabel()
This method get the xlink:label element. |
String |
getXLinkTitle()
This method get the xlink:title element. |
String |
getXLinkTo()
This method get the xlink:to element as string. |
String |
getXLinkType()
This method get the xlink:type element. |
boolean |
isValid()
This method check the validation of the content of this class. |
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(String set_href,
String set_label,
String set_title)
This method set a reference with xlink:href, xlink:label and xlink:title. |
void |
setXLinkLabel(String label)
This method set the xlink:label |
void |
setXLinkTitle(String title)
This method set the xlink:title |
| 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 |
| Field Detail |
|---|
public static final int MAX_XLINK_TYPE_LENGTH
public static final int MAX_XLINK_HREF_LENGTH
public static final int MAX_XLINK_LABEL_LENGTH
public static final int MAX_XLINK_TITLE_LENGTH
public static final int MAX_XLINK_FROM_LENGTH
public static final int MAX_XLINK_TO_LENGTH
protected String href
protected String label
protected String title
protected String linktype
protected String from
protected String to
| Constructor Detail |
|---|
public MCRMetaLink()
public MCRMetaLink(String set_datapart,
String set_subtag,
String default_lang,
int set_inherted)
throws MCRException
set_datapart - the global part of the elements like 'metadata' or 'service' or soset_subtag - the name of the subtagdefault_lang - the default languageset_inherted - a value >= 0
MCRException - if the set_datapart or set_subtag value is null or empty| Method Detail |
|---|
public void setReference(String set_href,
String set_label,
String set_title)
throws MCRException
set_href - the referenceset_label - the new label stringset_title - the new title string
MCRException - if the set_href value is null or empty
public void setBiLink(String set_from,
String set_to,
String set_title)
throws MCRException
set_from - the sourceset_to - the targetset_title - the new title string
MCRException - if the from or to element is null or emptypublic final String getXLinkType()
public final String getXLinkHref()
public final String getXLinkLabel()
public final void setXLinkLabel(String label)
label - the xlink:labelpublic final String getXLinkTitle()
public final void setXLinkTitle(String title)
title - the xlink:titlepublic final String getXLinkFrom()
public final String getXLinkTo()
public final boolean compare(MCRMetaLink input)
input - the MCRMetaLink input
public void setFromDOM(Element element)
throws MCRException
setFromDOM in interface MCRMetaInterfacesetFromDOM in class MCRMetaDefaultelement - a relevant DOM element for the metadata
MCRException - if the xlink:type is not locator or arc or if href or from and to are null or empty
public Element createXML()
throws MCRException
createXML in interface MCRMetaInterfacecreateXML in class MCRMetaDefaultMCRException - if the content of this class is not validpublic boolean isValid()
isValid in interface MCRMetaInterfaceisValid in class MCRMetaDefaultpublic final Object clone()
clone in interface MCRMetaInterfaceclone in class MCRMetaDefaultpublic final void debug()
debug in interface MCRMetaInterfacedebug in class MCRMetaDefault
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||