org.mycore.datamodel.metadata
Class MCRMetaClassification

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

public class MCRMetaClassification
extends MCRMetaDefault

This class implements all method for handling with the MCRMetaClassification part of a metadata object. The MCRMetaClassification class present a link to a category of a classification.

<tag class="MCRMetaClassification" heritable="...">
<subtag classid="..." categid="..." />
</tag>

Version:
$Revision: 14003 $ $Date: 2008-03-18 22:53:44 +0000 (Di, 18 Mrz 2008) $
Author:
Jens Kupferschmidt

Field Summary
protected  String categid
           
protected  String classid
           
static int MAX_CATEGID_LENGTH
           
static int MAX_CLASSID_LENGTH
          The length of the classification ID *
 
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
MCRMetaClassification()
          This is the constructor.
MCRMetaClassification(String set_datapart, String set_subtag, int set_inherted, String set_type, String set_classid, String set_categid)
          This is the constructor.
 
Method Summary
 Object clone()
          This method make a clone of this class.
 Element createXML()
          This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaClassification definition for the given subtag.
 void debug()
          This method put debug data to the logger (for the debug mode).
 String getCategId()
          The method return the category ID.
 String getClassId()
          The method return the classification ID.
 boolean isValid()
          This method check the validation of the content of this class.
 void setFromDOM(Element element)
          This method read the XML input stream part from a DOM part for the metadata of the document.
 void setValue(String set_classid, String set_categid)
          This method set values of classid and categid.
 
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

MAX_CLASSID_LENGTH

public static final int MAX_CLASSID_LENGTH
The length of the classification ID *

See Also:
Constant Field Values

MAX_CATEGID_LENGTH

public static final int MAX_CATEGID_LENGTH
See Also:
Constant Field Values

classid

protected String classid

categid

protected String categid
Constructor Detail

MCRMetaClassification

public MCRMetaClassification()
This is the constructor.
The language element was set to en . The classid and categid value was set to an empty string.


MCRMetaClassification

public MCRMetaClassification(String set_datapart,
                             String set_subtag,
                             int set_inherted,
                             String set_type,
                             String set_classid,
                             String set_categid)
                      throws MCRException
This is the constructor.
The language element was set to en . 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. The type element was set to an empty string. the set_classid and the categid must be not null or empty!

Parameters:
set_datapart - the global part of the elements like 'metadata' or 'service'
set_subtag - the name of the subtag
set_inherted - a value >= 0
set_type - the type attribute
set_classid - the classification ID
set_categid - the category ID
Throws:
MCRException - if the set_subtag value, the set_classid value or the set_categid are null, empty, too long or not a MCRObjectID
Method Detail

getClassId

public final String getClassId()
The method return the classification ID.

Returns:
the classId

getCategId

public final String getCategId()
The method return the category ID.

Returns:
the categId

setValue

public final void setValue(String set_classid,
                           String set_categid)
                    throws MCRException
This method set values of classid and categid.

Parameters:
set_classid - the classification ID
set_categid - the category ID
Throws:
MCRException - if the set_classid value or the set_categid are null, empty, too long or not a MCRObjectID

setFromDOM

public void setFromDOM(Element element)
                throws MCRException
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 MCRMetaDefault
Parameters:
element - a relevant JDOM element for the metadata
Throws:
MCRException - if the set_classid value or the set_categid are null, empty, too long or not a MCRObjectID

createXML

public Element createXML()
                  throws MCRException
This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaClassification definition for the given subtag.

Specified by:
createXML in interface MCRMetaInterface
Specified by:
createXML in class MCRMetaDefault
Returns:
a JDOM Element with the XML MCRClassification part
Throws:
MCRException - if the content of this class is not valid

isValid

public boolean isValid()
This method check the validation of the content of this class. The method returns true if
  • the subtag is not null or empty
otherwise the method return false

Specified by:
isValid in interface MCRMetaInterface
Overrides:
isValid in class MCRMetaDefault
Returns:
a boolean value

clone

public Object clone()
This method make a clone of this class.

Specified by:
clone in interface MCRMetaInterface
Specified by:
clone in class MCRMetaDefault

debug

public void debug()
This method put debug data to the logger (for the debug mode).

Specified by:
debug in interface MCRMetaInterface
Overrides:
debug in class MCRMetaDefault