public final class SchemaLoader extends Object
To find proto files to load, a non-empty set of sources are searched. Each source is either a regular directory or a ZIP file. Within ZIP files, proto files are expected to be found relative to the root of the archive.
Constructor and Description |
---|
SchemaLoader() |
Modifier and Type | Method and Description |
---|---|
SchemaLoader |
addProto(String proto)
Add a proto file to load.
|
SchemaLoader |
addSource(File file)
Add directory or zip file source from which proto files will be loaded.
|
SchemaLoader |
addSource(Path path)
Add directory or zip file source from which proto files will be loaded.
|
Schema |
load() |
List<String> |
protos()
Returns a mutable list of the protos that this loader will load.
|
List<Path> |
sources()
Returns a mutable list of the sources that this loader will load from.
|
public SchemaLoader addSource(File file)
public SchemaLoader addSource(Path path)
public List<Path> sources()
public SchemaLoader addProto(String proto)
public List<String> protos()
public Schema load() throws IOException
IOException
Copyright © 2013–2016 Square, Inc.. All rights reserved.