Package com.squareup.protoparser

Examples of com.squareup.protoparser.ProtoFile


   private Map<String, ProtoFile> parseInternal(Map<String, char[]> input) throws IOException, DescriptorParserException {
      Map<String, ProtoFile> fileMap = new LinkedHashMap<>();
      for (Map.Entry<String, char[]> entry : input.entrySet()) {
         CharArrayReader reader = new CharArrayReader(entry.getValue());
         ProtoFile protoFile = ProtoSchemaParser.parse(entry.getKey(), reader);
         fileMap.put(getFullName(protoFile), protoFile);
      }
      return fileMap;
   }
View Full Code Here


              .withDependencies(protoFiles)
              .build();
   }

   private FileDescriptor mapInternal(String fileName, String dependency, Set<String> processedFile) {
      ProtoFile pf = protoFileMap.get(dependency);
      if (pf == null) {
         throw new DescriptorParserException("Import '" + dependency + "' not found");
      }
      if (processedFile.contains(dependency)) {
         throw new DescriptorParserException("Possible cyclic import detected at " + fileName + ", import " + dependency);
View Full Code Here

   public Map<String, FileDescriptor> parse(FileDescriptorSource fileDescriptorSource) throws DescriptorParserException {
      Map<String, char[]> input = fileDescriptorSource.getFileDescriptors();
      Map<String, FileDescriptor> fileDescriptorMap = new LinkedHashMap<>(input.size());
      for (Map.Entry<String, char[]> entry : input.entrySet()) {
         try {
            ProtoFile protoFile = ProtoSchemaParser.parse(entry.getKey(), new CharArrayReader(entry.getValue()));
            FileDescriptor fileDescriptor = PROTOFILE_MAPPER.map(protoFile);
            fileDescriptorMap.put(entry.getKey(), fileDescriptor);
         } catch (IOException e) {
            throw new DescriptorParserException("Internal parsing error : " + e.getMessage());
         } catch (DescriptorParserException e) {
View Full Code Here

   private Map<String, ProtoFile> parseInternal(Map<String, char[]> input) throws IOException, DescriptorParserException {
      Map<String, ProtoFile> fileMap = new LinkedHashMap<>();
      for (Map.Entry<String, char[]> entry : input.entrySet()) {
         CharArrayReader reader = new CharArrayReader(entry.getValue());
         ProtoFile protoFile = ProtoSchemaParser.parse(entry.getKey(), reader);
         fileMap.put(getFullName(protoFile), protoFile);
      }
      return fileMap;
   }
View Full Code Here

TOP

Related Classes of com.squareup.protoparser.ProtoFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.