All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openprovenance.prov.sql.IDRefAdapter Maven / Gradle / Ivy

Go to download

Java Objects representing the PROV model, XML serialiser/deserialiser for them, and ORM mapping generated by HyperJaxb.

The newest version!
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;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy