use of org.jdom2.Content in project mycore by MyCoRe-Org.
the class MCRDerivate method createXML.
/**
* This methode create a XML stream for all object data.
*
* @exception MCRException
* if the content of this class is not valid
* @return a JDOM Document with the XML data of the object as byte array
*/
@Override
public final org.jdom2.Document createXML() throws MCRException {
Document doc = super.createXML();
Element elm = doc.getRootElement();
elm.addContent(mcr_derivate.createXML());
elm.addContent(mcr_service.createXML());
return doc;
}
use of org.jdom2.Content in project mycore by MyCoRe-Org.
the class MCRMetaBoolean method createXML.
/**
* This method create a XML stream for all data in this class, defined by
* the MyCoRe XML MCRBoolean definition for the given subtag.
*
* @exception MCRException
* if the content of this class is not valid
* @return a JDOM Element with the XML MCRBoolean part
*/
@Override
public Element createXML() throws MCRException {
Element elm = super.createXML();
elm.addContent(getValueToString());
return elm;
}
use of org.jdom2.Content in project mycore by MyCoRe-Org.
the class MCRMetaClassification method createXML.
/**
* This method create a XML stream for all data in this class, defined by
* the MyCoRe XML MCRMetaClassification definition for the given subtag.
*
* @exception MCRException
* if the content of this class is not valid
* @return a JDOM Element with the XML MCRClassification part
*/
@Override
public Element createXML() throws MCRException {
Element elm = super.createXML();
elm.setAttribute("classid", getClassId());
elm.setAttribute("categid", getCategId());
return elm;
}
use of org.jdom2.Content in project mycore by MyCoRe-Org.
the class MCRMetaDefault method createXML.
/**
* This abstract method create a XML stream for all data in this class,
* defined by the MyCoRe XML MCRMeta... definition for the given subtag.
*
* @exception MCRException
* if the content of this class is not valid
* @return a JDOM Element with the XML MCRMeta... part
*/
public Element createXML() throws MCRException {
try {
validate();
} catch (MCRException exc) {
debug();
throw exc;
}
Element elm = new Element(subtag);
if (getLang() != null && getLang().length() > 0)
elm.setAttribute("lang", getLang(), Namespace.XML_NAMESPACE);
if (getType() != null && getType().length() > 0) {
elm.setAttribute("type", getType());
}
elm.setAttribute("inherited", Integer.toString(getInherited()));
return elm;
}
use of org.jdom2.Content in project mycore by MyCoRe-Org.
the class MCRMetaHistoryDate method createXML.
/**
* This method creates a XML stream for all data in this class, defined by
* the MyCoRe XML MCRMetaHistoryDate definition for the given subtag.
*
* @exception MCRException
* if the content of this class is not valid
* @return a JDOM Element with the XML MCRMetaHistoryDate part
*/
@Override
public org.jdom2.Element createXML() throws MCRException {
Element elm = super.createXML();
for (MCRMetaHistoryDateText text : texts) {
Element elmt = new Element("text");
elmt.addContent(text.getText());
elmt.setAttribute("lang", text.getLang(), Namespace.XML_NAMESPACE);
elm.addContent(elmt);
}
elm.addContent(new org.jdom2.Element("calendar").addContent(calendar));
elm.addContent(new org.jdom2.Element("ivon").addContent(Integer.toString(ivon)));
elm.addContent(new org.jdom2.Element("von").addContent(getVonToString()));
elm.addContent(new org.jdom2.Element("ibis").addContent(Integer.toString(ibis)));
elm.addContent(new org.jdom2.Element("bis").addContent(getBisToString()));
return elm;
}
Aggregations