org.openprovenance.prov.sql.IDRefAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prov-sql Show documentation
Show all versions of prov-sql Show documentation
Java Objects representing the PROV model, XML serialiser/deserialiser for them, and ORM mapping generated by HyperJaxb.
package org.openprovenance.prov.sql;
import javax.xml.bind.annotation.adapters.XmlAdapter;
public class IDRefAdapter extends XmlAdapter {
final ProvFactory pf=new ProvFactory();
@Override
public IDRef marshal(org.openprovenance.prov.model.QualifiedName qualifiedName) throws Exception {
if (qualifiedName==null) {
return null;
} else {
IDRef res=new IDRef();
res.setRef(qualifiedName.toQName());
return res;
}
}
@Override
public QualifiedName unmarshal(IDRef ref) throws Exception {
if (ref==null) {
return null;
} else {
javax.xml.namespace.QName q= ref.getRef();
// QualifiedName qq=new QualifiedName(q.getNamespaceURI(), q.getLocalPart(), q.getPrefix());
QualifiedName qq=new QualifiedName(q);
return qq;
}
}
}