Class ProtobufSchemaLoader
java.lang.Object
tools.jackson.dataformat.protobuf.schema.ProtobufSchemaLoader
- All Implemented Interfaces:
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ProtobufSchemaLoaderStandard loader instance that is usually used for loading protoc schemas. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.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 Stringload(InputStream in) Method for loading and parsing a protoc definition from given stream, assuming UTF-8 encoding.load(InputStream in, String rootTypeName) Method for loading and parsing a protoc definition from given stream, assuming UTF-8 encoding.loadNative(File f) loadNative(InputStream in, boolean close) protected NativeProtobufSchemaloadNative(Reader r, boolean close) loadNative(URL url) Method for parsing given protoc schema definition, constructing schema object Jackson can use.parseNative(String schema)
-
Field Details
-
DEFAULT_SCHEMA_NAME
- See Also:
-
std
Standard loader instance that is usually used for loading protoc schemas.
-
-
Constructor Details
-
ProtobufSchemaLoader
public ProtobufSchemaLoader()
-
-
Method Details
-
load
- Throws:
IOException
-
load
- Parameters:
rootTypeName- Name of message type in schema definition that is the root value to read/write- Throws:
IOException
-
load
- Throws:
IOException
-
load
- Parameters:
rootTypeName- Name of message type in schema definition that is the root value to read/write- Throws:
IOException
-
load
Method for loading and parsing a protoc definition from given stream, assuming UTF-8 encoding. Note that givenInputStreamwill be closed before method returns.- Throws:
IOException
-
load
- Parameters:
rootTypeName- Name of message type in schema definition that is the root value to read/write- Throws:
IOException
-
load
Method for loading and parsing a protoc definition from given stream, assuming UTF-8 encoding. Note that givenReaderwill be closed before method returns.- Throws:
IOException
-
load
- Parameters:
rootTypeName- Name of message type in schema definition that is the root value to read/write- Throws:
IOException
-
parse
Method for parsing given protoc schema definition, constructing schema object Jackson can use.- Throws:
IOException
-
parse
- Parameters:
rootTypeName- Name of message type in schema definition that is the root value to read/write- Throws:
IOException
-
loadNative
- Throws:
IOException
-
loadNative
- Throws:
IOException
-
parseNative
- Throws:
IOException
-
loadNative
- Throws:
IOException
-
loadNative
- Throws:
IOException
-
_loadNative
- Throws:
IOException
-
_loadNative
- Throws:
IOException
-
_loadNative
- 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
- Throws:
IOException
-