com.fasterxml.jackson.dataformat.protobuf.schema

## Class ProtobufSchemaLoader

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

- All Implemented Interfaces:
    Serializable

      public class ProtobufSchemaLoader
      extends Object
      implements Serializable

  Class used for loading protobuf definitions (from .proto files or equivalent sources), to construct schema needed for reading or writing content.

  Note that message name argument is optional if (and only if) desired root type is the first Message type in definition; otherwise an exception will be thrown.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_SCHEMA_NAME`
    `static ProtobufSchemaLoader` | `std` Standard loader instance that is usually used for loading protoc schemas.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProtobufSchemaLoader()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.squareup.protoparser.ProtoFile` | `_loadNative(File f)`
    `com.squareup.protoparser.ProtoFile` | `_loadNative(InputStream in, boolean close)`
    `protected com.squareup.protoparser.ProtoFile` | `_loadNative(Reader r, boolean close)`
    `com.squareup.protoparser.ProtoFile` | `_loadNative(String schemaAsString)`
    `com.squareup.protoparser.ProtoFile` | `_loadNative(URL url)`
    `protected String` | `_readAll(Reader r)`
    `void` | `_throw(Exception e0)`
    `ProtobufSchema` | `load(File f)`
    `ProtobufSchema` | `load(File f, String rootTypeName)`
    `ProtobufSchema` | `load(InputStream in)` Method for loading and parsing a protoc definition from given stream, assuming UTF-8 encoding.
    `ProtobufSchema` | `load(InputStream in, String rootTypeName)`
    `ProtobufSchema` | `load(Reader r)` Method for loading and parsing a protoc definition from given stream, assuming UTF-8 encoding.
    `ProtobufSchema` | `load(Reader r, String rootTypeName)`
    `ProtobufSchema` | `load(URL url)`
    `ProtobufSchema` | `load(URL url, String rootTypeName)`
    `NativeProtobufSchema` | `loadNative(File f)`
    `NativeProtobufSchema` | `loadNative(InputStream in, boolean close)`
    `protected NativeProtobufSchema` | `loadNative(Reader r, boolean close)`
    `NativeProtobufSchema` | `loadNative(URL url)`
    `ProtobufSchema` | `parse(String schemaAsString)` Method for parsing given protoc schema definition, constructing schema object Jackson can use.
    `ProtobufSchema` | `parse(String schemaAsString, String rootTypeName)`
    `NativeProtobufSchema` | `parseNative(String schema)`

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

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

- - ### Field Detail

    - #### DEFAULT_SCHEMA_NAME

          public static final String DEFAULT_SCHEMA_NAME

      See Also:
        Constant Field Values

    - #### std

          public static final ProtobufSchemaLoader std

      Standard loader instance that is usually used for loading protoc schemas.

  - ### Constructor Detail

    - #### ProtobufSchemaLoader

          public ProtobufSchemaLoader()

  - ### Method Detail

    - #### load

          public ProtobufSchema load(URL url)
                              throws IOException

      Throws:
        `IOException`

    - #### load

          public ProtobufSchema load(URL url,
                            String rootTypeName)
                              throws IOException

      Parameters:
        `rootTypeName` - Name of message type in schema definition that is the root value to read/write
      Throws:
        `IOException`

    - #### load

          public ProtobufSchema load(File f)
                              throws IOException

      Throws:
        `IOException`

    - #### load

          public ProtobufSchema load(File f,
                            String rootTypeName)
                              throws IOException

      Parameters:
        `rootTypeName` - Name of message type in schema definition that is the root value to read/write
      Throws:
        `IOException`

    - #### load

          public ProtobufSchema load(InputStream in)
                              throws IOException

      Method for loading and parsing a protoc definition from given stream, assuming UTF-8 encoding. Note that given `InputStream` will be closed before method returns.
      Throws:
        `IOException`

    - #### load

          public ProtobufSchema load(InputStream in,
                            String rootTypeName)
                              throws IOException

      Parameters:
        `rootTypeName` - Name of message type in schema definition that is the root value to read/write
      Throws:
        `IOException`

    - #### load

          public ProtobufSchema load(Reader r)
                              throws IOException

      Method for loading and parsing a protoc definition from given stream, assuming UTF-8 encoding. Note that given `Reader` will be closed before method returns.
      Throws:
        `IOException`

    - #### load

          public ProtobufSchema load(Reader r,
                            String rootTypeName)
                              throws IOException

      Parameters:
        `rootTypeName` - Name of message type in schema definition that is the root value to read/write
      Throws:
        `IOException`

    - #### parse

          public ProtobufSchema parse(String schemaAsString)
                               throws IOException

      Method for parsing given protoc schema definition, constructing schema object Jackson can use.
      Throws:
        `IOException`

    - #### parse

          public ProtobufSchema parse(String schemaAsString,
                             String rootTypeName)
                               throws IOException

      Parameters:
        `rootTypeName` - Name of message type in schema definition that is the root value to read/write
      Throws:
        `IOException`

    - #### loadNative

          public NativeProtobufSchema loadNative(File f)
                                          throws IOException

      Throws:
        `IOException`

    - #### loadNative

          public NativeProtobufSchema loadNative(URL url)
                                          throws IOException

      Throws:
        `IOException`

    - #### parseNative

          public NativeProtobufSchema parseNative(String schema)
                                           throws IOException

      Throws:
        `IOException`

    - #### loadNative

          public NativeProtobufSchema loadNative(InputStream in,
                                        boolean close)
                                          throws IOException

      Throws:
        `IOException`

    - #### loadNative

          protected NativeProtobufSchema loadNative(Reader r,
                                        boolean close)
                                             throws IOException

      Throws:
        `IOException`

    - #### _loadNative

          public com.squareup.protoparser.ProtoFile _loadNative(File f)
                                                         throws IOException

      Throws:
        `IOException`

    - #### _loadNative

          public com.squareup.protoparser.ProtoFile _loadNative(URL url)
                                                         throws IOException

      Throws:
        `IOException`

    - #### _loadNative

          public com.squareup.protoparser.ProtoFile _loadNative(String schemaAsString)
                                                         throws IOException

      Throws:
        `IOException`

    - #### _loadNative

          public com.squareup.protoparser.ProtoFile _loadNative(InputStream in,
                                                       boolean close)
                                                         throws IOException

      Throws:
        `IOException`

    - #### _loadNative

          protected com.squareup.protoparser.ProtoFile _loadNative(Reader r,
                                                       boolean close)
                                                            throws IOException

      Throws:
        `IOException`

    - #### _readAll

          protected String _readAll(Reader r)
                             throws IOException

      Throws:
        `IOException`

    - #### _throw

          public void _throw(Exception e0)
                      throws IOException

      Throws:
        `IOException`

Copyright © 2016 FasterXML. All rights reserved.