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

org.infinispan.protostream.DescriptorParser Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.protostream;

import java.util.Map;

import org.infinispan.protostream.descriptors.FileDescriptor;

/**
 * Main parser interface.
 *
 * @author gustavonalle
 * @author [email protected]
 * @since 2.0
 */
public interface DescriptorParser {

   /**
    * Parses a set of .proto files and resolves imports and types.
    *
    * @param fileDescriptorSource the set of descriptors to parse
    * @return map of FileDescriptor objects keyed by with their names
    */
   Map parseAndResolve(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 the {@link FileDescriptorSource} parameter 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.
    *
    * @param fileDescriptorSource the set of descriptors to parse
    * @return a map of successfully parsed {@link FileDescriptor} objects keyed by with their names
    * @throws DescriptorParserException if parsing errors were encountered and no progress callback was specified in the
    *                                   {@link FileDescriptorSource}
    */
   Map parse(FileDescriptorSource fileDescriptorSource) throws DescriptorParserException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy