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

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

Go to download

Java Objects representing the PROV model and an XML serialiser/deserialiser for them. Classes were initially generated by JAXB, from the XML schema for PROV, and over time edited by hand.

There is a newer version: 1.0.0
Show newest version
package org.openprovenance.prov.xml;

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 {
            return new IDRef(qualifiedName.toQName());
        }
    }

    @Override
    public QualifiedName unmarshal(IDRef ref) throws Exception {
        if (ref==null) {
            return null;
        } else {
            //System.out.println("unmarshalling " + ref);
            javax.xml.namespace.QName q=  ref.getRef();
            //System.out.println("unmarshalling found " + q);
            QualifiedName qq=new QualifiedName(q);
            return qq;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy