org.mycore.datamodel.metadata
Class MCRMetaPersonName

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

public final class MCRMetaPersonName
extends MCRMetaDefault

This class implements all methods for handling with the MCRMetaPersonName part of a metadata object. The MCRMetaPersonName class represents a natural person specified by a list of names.

Version:
$Revision: 14003 $ $Date: 2008-09-16 11:45:07 +0200 (Di, 16 Sep 2008) $
Author:
J. Vogler

Field Summary
 
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
MCRMetaPersonName()
          This is the constructor.
MCRMetaPersonName(String set_datapart, String set_subtag, String default_lang, String set_type, int set_inherted, String set_firstname, String set_callname, String set_surname, String set_fullname, String set_academic, String set_peerage, String set_prefix)
          This is the constructor.
 
Method Summary
 Object clone()
          This method make a clone of this class.
 Element createXML()
          This method creates a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaPersonName definition for the given subtag.
 void debug()
          This method put debug data to the logger (for the debug mode).
 String getAcademic()
          This method get the academic text element.
 String getCallName()
          This method get the callname text element.
 String getFirstName()
          This method get the firstname text element.
 String getFullName()
          This method get the fullname text element.
 String getPeerage()
          This method get the peerage text element.
 String getPrefix()
          This method get the prefix text element.
 String getSurName()
          This method get the surname text element.
 boolean isValid()
          This method checks the validation of the content of this class.
 void set(String set_firstname, String set_callname, String set_surname, String set_fullname, String set_academic, String set_peerage, String set_prefix)
          This methode set all name componets.
 void setFromDOM(Element element)
          This method reads the XML input stream part from a DOM part for the metadata of the document.
 
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

MCRMetaPersonName

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


MCRMetaPersonName

public MCRMetaPersonName(String set_datapart,
                         String set_subtag,
                         String default_lang,
                         String set_type,
                         int set_inherted,
                         String set_firstname,
                         String set_callname,
                         String set_surname,
                         String set_fullname,
                         String set_academic,
                         String set_peerage,
                         String set_prefix)
                  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. The type element was set to the value of set_type, if it is null, an empty string was set to the type element. The firstname, callname, surname, academic and peerage element was set to the value of set_..., if they are null, an empty string was set to this element.

Parameters:
set_datapart - the global part of the elements like 'metadata' or 'service'
set_subtag - the name of the subtag
default_lang - the default language
set_type - the optional type string
set_inherted - a value >= 0
set_firstname - the first name
set_callname - the callname
set_surname - the surname
set_fullname - the fullname
set_academic - the academic title
set_peerage - the peerage title
set_prefix - the prefix title
Throws:
MCRException - if the parameter values are invalid
Method Detail

set

public final void set(String set_firstname,
                      String set_callname,
                      String set_surname,
                      String set_fullname,
                      String set_academic,
                      String set_peerage,
                      String set_prefix)
This methode set all name componets.

Parameters:
set_firstname - the first name
set_callname - the callname
set_surname - the surname
set_fullname - the fullname
set_academic - the academic title
set_peerage - the peerage title
set_prefix - the prefix title

getFirstName

public final String getFirstName()
This method get the firstname text element.

Returns:
the firstname

getCallName

public final String getCallName()
This method get the callname text element.

Returns:
the callname

getSurName

public final String getSurName()
This method get the surname text element.

Returns:
the surname

getFullName

public final String getFullName()
This method get the fullname text element.

Returns:
the fullname

getAcademic

public final String getAcademic()
This method get the academic text element.

Returns:
the academic

getPeerage

public final String getPeerage()
This method get the peerage text element.

Returns:
the peerage

getPrefix

public final String getPrefix()
This method get the prefix text element.

Returns:
the prefix

setFromDOM

public final void setFromDOM(Element element)
This method reads 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

createXML

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

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

isValid

public final boolean isValid()
This method checks the validation of the content of this class. The method returns false if
  • the firstname is empty and
  • the surname is empty
otherwise the method returns true.

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

clone

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

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

debug

public final 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