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

org.opencds.cqf.cql.engine.serializing.jackson.XmlCqlLibraryReader Maven / Gradle / Ivy

package org.opencds.cqf.cql.engine.serializing.jackson;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.net.URI;
import java.net.URL;

import org.cqframework.cql.elm.execution.Library;
import org.opencds.cqf.cql.engine.serializing.CqlLibraryReader;

public class XmlCqlLibraryReader implements CqlLibraryReader {

    public XmlCqlLibraryReader() {
    }

    public Library read(File file) throws IOException {
        return XmlCqlMapper.getMapper().readValue(file, Library.class);
    }

    public Library read(URL url) throws IOException {
        return XmlCqlMapper.getMapper().readValue(url, Library.class);
    }

    public Library read(URI uri) throws IOException {
        return XmlCqlMapper.getMapper().readValue(uri.toURL(), Library.class);
    }

    public Library read(String string) throws IOException {
        return XmlCqlMapper.getMapper().readValue(string, Library.class);
    }

    public Library read(InputStream inputStream) throws IOException {
        return XmlCqlMapper.getMapper().readValue(inputStream, Library.class);
    }

    public Library read(Reader reader) throws IOException {
        return XmlCqlMapper.getMapper().readValue(reader, Library.class);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy