public static final class SoyProtoTypeProvider.Builder extends Object
| Constructor and Description |
|---|
SoyProtoTypeProvider.Builder() |
| Modifier and Type | Method and Description |
|---|---|
SoyProtoTypeProvider.Builder |
addDescriptors(Iterable<? extends com.google.protobuf.Descriptors.GenericDescriptor> descriptorsToAdd)
Registers a collection of descriptors of any type.
|
SoyProtoTypeProvider.Builder |
addFileDescriptorSet(com.google.protobuf.DescriptorProtos.FileDescriptorSet descriptorSet)
Given file descriptor set, register any proto types found within.
|
SoyProtoTypeProvider.Builder |
addFileDescriptorSetFromFile(File descriptorFile)
Read a file descriptor set from a file and register any proto types found within.
|
SoyProtoTypeProvider |
build()
Builds the type provider and returns it.
|
SoyProtoTypeProvider |
buildNoFiles()
Like
build(), but doesn't propagate exceptions that can only arise when descriptors
need to be fetched from the filesystem. |
boolean |
isEmpty()
Assumes there are no empty descriptor files and descriptor sets which is mostly true
in practice.
|
public SoyProtoTypeProvider.Builder addFileDescriptorSetFromFile(File descriptorFile)
public SoyProtoTypeProvider.Builder addFileDescriptorSet(com.google.protobuf.DescriptorProtos.FileDescriptorSet descriptorSet)
public SoyProtoTypeProvider.Builder addDescriptors(Iterable<? extends com.google.protobuf.Descriptors.GenericDescriptor> descriptorsToAdd)
public boolean isEmpty()
public SoyProtoTypeProvider build() throws FileNotFoundException, IOException, com.google.protobuf.Descriptors.DescriptorValidationException
FileNotFoundExceptionIOExceptioncom.google.protobuf.Descriptors.DescriptorValidationExceptionpublic SoyProtoTypeProvider buildNoFiles()
build(), but doesn't propagate exceptions that can only arise when descriptors
need to be fetched from the filesystem.