Class ProtostreamProtoParser
java.lang.Object
org.infinispan.protostream.impl.parser.ProtostreamProtoParser
Parser for .proto files based on the Protoparser.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static ThreadLocal<StringBuilder> private final Configuration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse(FileDescriptorSource fileDescriptorSource) Parses a set of .proto files but does not resolve type dependencies and does not detect semantic errors like duplicate type definitions.private voidreportParsingError(FileDescriptorSource fileDescriptorSource, Map<String, FileDescriptor> fileDescriptorMap, String fileName, DescriptorParserException dpe) Report the error to the callback if any, or just throw it otherwise.
-
Field Details
-
comments
-
configuration
-
-
Constructor Details
-
ProtostreamProtoParser
-
-
Method Details
-
parse
public Map<String, FileDescriptor> parse(FileDescriptorSource fileDescriptorSource) throws DescriptorParserException Parses a set of .proto files but does not resolve type dependencies and does not detect semantic errors like duplicate type definitions. If theFileDescriptorSourceparameter does not include a progress callback parsing will stop on first encountered error. If a callback exists all files will be processed; only one error per file is reported and parsing will continue with the next file.- Parameters:
fileDescriptorSource- the set of descriptors to parse- Returns:
- a map of successfully parsed
FileDescriptorobjects keyed by with their names - Throws:
DescriptorParserException- if parsing errors were encountered and no progress callback was specified in theFileDescriptorSource
-
reportParsingError
private void reportParsingError(FileDescriptorSource fileDescriptorSource, Map<String, FileDescriptor> fileDescriptorMap, String fileName, DescriptorParserException dpe) Report the error to the callback if any, or just throw it otherwise.
-