Class DataCiteXmlMapper
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.reference.datacite.DataCiteXmlMapper
-
public class DataCiteXmlMapper extends java.lang.Object
Class to map an eDALMetaData
object to a valid DataCite XML document.
-
-
Constructor Summary
Constructors Constructor Description DataCiteXmlMapper(PrimaryDataEntityVersion version)
Constructor to set theMetaData
for thisDataCiteXmlMapper
.
-
Method Summary
Modifier and Type Method Description javax.xml.bind.Marshaller
createXmlMarshaller()
Generate a JAXB-Marshaller
for aXmlResource
object.XmlResource
createXmlResource()
Create aXmlResource
from the givenMetaData
and validate the Document against the DataCite Schema before return.protected MetaData
getMetaData()
Getter for theMetaData
of thisDataCiteXmlMapper
.protected PrimaryDataEntityVersion
getVersion()
Getter for thePrimaryDataEntityVersion
of thisDataCiteXmlMapper
.void
validateSchema(XmlResource resource)
Validate theMetaData
schema of the generatedXmlResource
.
-
-
-
Constructor Detail
-
DataCiteXmlMapper
public DataCiteXmlMapper(PrimaryDataEntityVersion version)
Constructor to set theMetaData
for thisDataCiteXmlMapper
.- Parameters:
version
- thePrimaryDataEntityVersion
to create DataCite xml.
-
-
Method Detail
-
createXmlMarshaller
public javax.xml.bind.Marshaller createXmlMarshaller() throws EdalPublicationMetaDataException
Generate a JAXB-Marshaller
for aXmlResource
object.- Returns:
- the generated JAXB-
Marshaller
. - Throws:
EdalPublicationMetaDataException
- if unable to initializeMarshaller
.
-
createXmlResource
public XmlResource createXmlResource() throws EdalPublicationMetaDataException
Create aXmlResource
from the givenMetaData
and validate the Document against the DataCite Schema before return.- Returns:
- the valid
XmlResource
. - Throws:
EdalPublicationMetaDataException
- if unable to createXmlResource
.
-
getMetaData
protected MetaData getMetaData()
Getter for theMetaData
of thisDataCiteXmlMapper
.- Returns:
- the set
MetaData
.
-
getVersion
protected PrimaryDataEntityVersion getVersion()
Getter for thePrimaryDataEntityVersion
of thisDataCiteXmlMapper
.- Returns:
- the
PrimaryDataEntityVersion
to thisDataCiteXmlMapper
.
-
validateSchema
public void validateSchema(XmlResource resource) throws EdalPublicationMetaDataException
Validate theMetaData
schema of the generatedXmlResource
.- Parameters:
resource
- theXmlResource
to check.- Throws:
EdalPublicationMetaDataException
- if validation failed.
-
-