public final class FileDescriptorSource extends Object
SerializationContext.registerProtoFiles(FileDescriptorSource).| Modifier and Type | Class and Description |
|---|---|
static interface |
FileDescriptorSource.ProgressCallback
A callback interface that receives status notifications during the processing of files defined by a
FileDescriptorSource. |
| Constructor and Description |
|---|
FileDescriptorSource() |
public FileDescriptorSource withProgressCallback(FileDescriptorSource.ProgressCallback progressCallback)
null callback indicates that errors are to be reported immediately and the
operation should be aborted on first error.progressCallback - the callback, can be nullpublic FileDescriptorSource addProtoFiles(String... classpathResources) throws IOException
IOExceptionpublic FileDescriptorSource addProtoFiles(ClassLoader userClassLoader, String... classpathResources) throws IOException
IOExceptionpublic FileDescriptorSource addProtoFile(String name, String contents)
public FileDescriptorSource addProtoFile(String name, InputStream contents) throws IOException
IOExceptionpublic FileDescriptorSource addProtoFile(String name, Reader contents) throws IOException
IOExceptionpublic FileDescriptorSource addProtoFile(String name, File protofile) throws IOException
IOExceptionpublic static FileDescriptorSource fromResources(ClassLoader userClassLoader, String... classPathResources) throws IOException
IOExceptionpublic static FileDescriptorSource fromResources(String... classPathResources) throws IOException
IOExceptionpublic static FileDescriptorSource fromString(String name, String protoSource)
public FileDescriptorSource.ProgressCallback getProgressCallback()
public static String getResourceAsString(Class<?> c, String name) throws UncheckedIOException
UncheckedIOExceptionCopyright © 2020 JBoss, a division of Red Hat. All rights reserved.