Class MCRMetaInstitutionName

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

public final class MCRMetaInstitutionName extends MCRMetaDefault
This class implements all methods for handling with the MCRMetaInstitutionName part of a metadata object. The MCRMetaInstitutionName class represents a name of an institution or corporation.
Version:
$Revision$ $Date$
Author:
J. Kupferschmidt
  • Constructor Details

    • MCRMetaInstitutionName

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

      public MCRMetaInstitutionName(String subtag, String lang, String type, int inherted, String fullname, String nickname, String property) throws MCRException
      This is the constructor.
      The language element was set. If the value of lang is null, empty or false en was set. The subtag element was set to the value of subtag. If the value of subtag is null or empty an exception was throwed. The type element was set to the value of type, if it is null, an empty string was set to the type element. The fullname, nickname and property element was set to the value of set_..., if they are null, an empty string was set to this element.
      Parameters:
      subtag - the name of the subtag
      lang - the default language
      type - the optional type string
      inherted - a value >= 0
      fullname - the full name
      nickname - the nickname
      property - the property title
      Throws:
      MCRException - if the parameter values are invalid
  • Method Details

    • set

      public void set(String fullname, String nickname, String property)
      This methode set all name componets.
      Parameters:
      fullname - the full name
      nickname - the nickname
      property - the property title
    • getFullName

      public String getFullName()
      This method get the name text element.
      Returns:
      the fullname
    • getNickname

      public String getNickname()
      This method get the nickname text element.
      Returns:
      the nickname
    • getProperty

      public String getProperty()
      This method get the property text element.
      Returns:
      the property
    • setFromDOM

      public 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 DOM element for the metadata
    • createXML

      public Element createXML() throws MCRException
      This method creates a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaInstitutionName definition for the given subtag.
      Specified by:
      createXML in interface MCRMetaInterface
      Overrides:
      createXML in class MCRMetaDefault
      Returns:
      a JDOM Element with the XML MCRMetaInstitutionName part
      Throws:
      MCRException - if the content of this class is not valid
    • createJSON

      public com.google.gson.JsonObject createJSON()
      Creates the JSON representation. Extends the MCRMetaDefault.createJSON() method with the following data.
         {
           fullname: "library of congress",
           nickname: "LOC",
           property: "USA"
         }
       
      Specified by:
      createJSON in interface MCRMetaInterface
      Overrides:
      createJSON in class MCRMetaDefault
      Returns:
      a GSON object containing the json data of the metadata part
    • validate

      public void validate() throws MCRException
      Validates this MCRMetaInstitutionName. This method throws an exception if:
      • the subtag is not null or empty
      • the lang value was supported
      • the inherited value is lower than zero
      • the trimmed fullname is null or empty
      Specified by:
      validate in interface MCRMetaInterface
      Overrides:
      validate in class MCRMetaDefault
      Throws:
      MCRException - the MCRMetaInstitutionName is invalid
    • clone

      public MCRMetaInstitutionName clone()
      clone of this instance you will get a (deep) clone of this element
      Specified by:
      clone in interface MCRMetaInterface
      Overrides:
      clone in class MCRMetaDefault
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class MCRMetaDefault