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

io.deephaven.engine.table.lang.impl.QueryLibraryImportsConfiguration Maven / Gradle / Ivy

There is a newer version: 0.37.1
Show newest version
/**
 * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
 */
package io.deephaven.engine.table.lang.impl;

import com.google.auto.service.AutoService;
import io.deephaven.configuration.Configuration;
import io.deephaven.engine.context.QueryLibraryImports;
import io.deephaven.engine.util.ClassList;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

@AutoService(QueryLibraryImports.class)
public class QueryLibraryImportsConfiguration implements QueryLibraryImports {

    @Override
    public Set packages() {
        try {
            return new HashSet<>(ClassList
                    .readPackageList(Configuration.getInstance().getProperty("QueryLibrary.defaultPackageImportList")));
        } catch (IOException e) {
            throw new RuntimeException("Can not load default class imports", e);
        }
    }

    @Override
    public Set> classes() {
        try {
            return new HashSet<>(ClassList.readClassListAsCollection(
                    Configuration.getInstance().getProperty("QueryLibrary.defaultClassImportList")));
        } catch (IOException | ClassNotFoundException e) {
            throw new RuntimeException("Can not load default class imports", e);
        }
    }

    @Override
    public Set> statics() {
        try {
            return new HashSet<>(ClassList.readClassListAsCollection(
                    Configuration.getInstance().getProperty("QueryLibrary.defaultStaticImportList")));
        } catch (IOException | ClassNotFoundException e) {
            throw new RuntimeException("Can not load default static imports", e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy