com.fasterxml.jackson.dataformat.protobuf.schema

## Class DescriptorLoader

- java.lang.Object
- - com.fasterxml.jackson.dataformat.protobuf.schema.DescriptorLoader

-     public class DescriptorLoader
      extends Object

  Class used for loading protobuf descriptors (from .desc files or equivalent sources), to construct FileDescriptorSet.
  Since:
    2.9

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected com.fasterxml.jackson.databind.ObjectReader` | `_reader` Fully configured reader for `FileDescriptorSet` objects.
    `protected static String` | `DESCRIPTOR_PROTO`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DescriptorLoader(com.fasterxml.jackson.databind.ObjectReader reader)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DescriptorLoader` | `construct(com.fasterxml.jackson.databind.ObjectMapper mapper, ProtobufSchemaLoader schemaLoader)`
    `static DescriptorLoader` | `construct(ProtobufMapper mapper)`
    `FileDescriptorSet` | `load(File src)`
    `FileDescriptorSet` | `load(InputStream in)` Note: passed `InputStream` will be closed by this method.
    `FileDescriptorSet` | `load(Reader r)` Note: passed `Reader` will be closed by this method.
    `FileDescriptorSet` | `load(URL src)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DESCRIPTOR_PROTO

          protected static final String DESCRIPTOR_PROTO

      See Also:
        Constant Field Values

    - #### _reader

          protected final com.fasterxml.jackson.databind.ObjectReader _reader

      Fully configured reader for `FileDescriptorSet` objects.

  - ### Constructor Detail

    - #### DescriptorLoader

          public DescriptorLoader(com.fasterxml.jackson.databind.ObjectReader reader)

      Parameters:
        `reader` - `ObjectReader` that is able to read protobuf input (that is, must have been created from `ProtobufMapper`, or regular mapper with `ProtobufFactory`), and has been configured with `protoc` definition of `descriptor.proro`

  - ### Method Detail

    - #### construct

          public static DescriptorLoader construct(ProtobufMapper mapper)
                                            throws IOException

      Throws:
        `IOException`

    - #### construct

          public static DescriptorLoader construct(com.fasterxml.jackson.databind.ObjectMapper mapper,
                                                   ProtobufSchemaLoader schemaLoader)
                                            throws IOException

      Parameters:
        `mapper` - `ObjectMapper` that can reader protoc content.
      Throws:
        `IOException`

    - #### load

          public FileDescriptorSet load(URL src)
                                 throws IOException

      Throws:
        `IOException`

    - #### load

          public FileDescriptorSet load(File src)
                                 throws IOException

      Throws:
        `IOException`

    - #### load

          public FileDescriptorSet load(InputStream in)
                                 throws IOException

      Note: passed `InputStream` will be closed by this method.
      Throws:
        `IOException`

    - #### load

          public FileDescriptorSet load(Reader r)
                                 throws IOException

      Note: passed `Reader` will be closed by this method.
      Throws:
        `IOException`

Copyright © 2019 FasterXML. All rights reserved.