Package org.mycore.datamodel.metadata
Class MCRMetaXML
java.lang.Object
org.mycore.datamodel.metadata.MCRMetaDefault
org.mycore.datamodel.metadata.MCRMetaXML
- All Implemented Interfaces:
Cloneable
,MCRMetaInterface
This class implements all method for handling with the MCRMetaLangText part
of a metadata object. The MCRMetaLangText class present a single item, which
has triples of a text and his corresponding language and optional a type.
- Version:
- $Revision$ $Date$
- Author:
- Thomas Scheffler (yagee), Jens Kupferschmidt, Johannes Bühler
-
Field Summary
Fields inherited from class org.mycore.datamodel.metadata.MCRMetaDefault
datapart, DEFAULT_ATTRIBUTE_INHERITED, DEFAULT_ATTRIBUTE_LANG, DEFAULT_ATTRIBUTE_SEQUENCE, DEFAULT_ATTRIBUTE_TYPE, DEFAULT_ELEMENT_DATAPART, DEFAULT_INHERITED, DEFAULT_LANG_LENGTH, DEFAULT_LANGUAGE, DEFAULT_SEQUENCE, DEFAULT_STRING_LENGTH, DEFAULT_TYPE_LENGTH, inherited, lang, NL, sequence, subtag, type
-
Constructor Summary
ConstructorDescriptionThis is the constructor.MCRMetaXML
(String subtag, String type, int inherited) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContent
(Content content) clone()
This method make a clone of this class.com.google.gson.JsonObject
Creates the JSON representation.This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaLangText definition for the given subtag.void
debug()
This method put debug data to the logger (for the debug mode).boolean
void
setFromDOM
(Element element) This method read the XML input stream part from a DOM part for the metadata of the document.void
validate()
Validates this MCRMetaXML.Methods inherited from class org.mycore.datamodel.metadata.MCRMetaDefault
debugDefault, decrementInherited, getInherited, getLang, getSequence, getSubTag, getType, hashCode, incrementInherited, isValid, setInherited, setLang, setSequence, setSubTag, setType
-
Constructor Details
-
MCRMetaXML
public MCRMetaXML()This is the constructor.
Set the java.util.ArrayList of child elements to new. -
MCRMetaXML
- Throws:
MCRException
-
-
Method Details
-
setFromDOM
This method read the XML input stream part from a DOM part for the metadata of the document.- Specified by:
setFromDOM
in interfaceMCRMetaInterface
- Overrides:
setFromDOM
in classMCRMetaDefault
- Parameters:
element
- a relevant JDOM element for the metadata
-
addContent
-
getContent
-
createXML
This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaLangText definition for the given subtag.- Specified by:
createXML
in interfaceMCRMetaInterface
- Overrides:
createXML
in classMCRMetaDefault
- Returns:
- a JDOM Element with the XML MCRMetaLangText part
- Throws:
MCRException
- if the content of this class is not valid
-
createJSON
public com.google.gson.JsonObject createJSON()Creates the JSON representation. Extends theMCRMetaDefault.createJSON()
method with the following data.{ content: [ ... json objects of parsed content ... ] }
- Specified by:
createJSON
in interfaceMCRMetaInterface
- Overrides:
createJSON
in classMCRMetaDefault
- Returns:
- a GSON object containing the json data of the metadata part
- See Also:
-
validate
Validates this MCRMetaXML. 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 content is null
- Specified by:
validate
in interfaceMCRMetaInterface
- Overrides:
validate
in classMCRMetaDefault
- Throws:
MCRException
- the MCRMetaXML is invalid
-
clone
This method make a clone of this class.- Specified by:
clone
in interfaceMCRMetaInterface
- Overrides:
clone
in classMCRMetaDefault
-
debug
public void debug()This method put debug data to the logger (for the debug mode).- Specified by:
debug
in interfaceMCRMetaInterface
- Overrides:
debug
in classMCRMetaDefault
-
equals
- Overrides:
equals
in classMCRMetaDefault
-