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

io.protostuff.compiler.parser.ProtoFileReader Maven / Gradle / Ivy

There is a newer version: 3.1.40
Show newest version
package io.protostuff.compiler.parser;

import com.google.inject.assistedinject.Assisted;

import org.antlr.v4.runtime.CharStream;

import java.nio.file.Path;
import java.util.List;

import javax.annotation.Nullable;
import javax.inject.Inject;

/**
 * @author Kostiantyn Shchepanovskyi
 */
public class ProtoFileReader implements FileReader {

    private final List includePathList;
    private final FileReader delegate;

    @Inject
    public ProtoFileReader(@Assisted List includePathList) {
        this.includePathList = includePathList;
        ClasspathFileReader classpathFileReader = new ClasspathFileReader();
        LocalFileReader localFileReader = new LocalFileReader(includePathList);
        delegate = new CompositeFileReader(localFileReader, classpathFileReader);
    }

    @Nullable
    @Override
    public CharStream read(String name) {
        return delegate.read(name);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy