public class ProtobufSchemaLoader extends Object implements Serializable
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.
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 and Description |
---|
ProtobufSchemaLoader() |
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) |
public static final String DEFAULT_SCHEMA_NAME
public static final ProtobufSchemaLoader std
public ProtobufSchema load(URL url) throws IOException
IOException
public ProtobufSchema load(URL url, String rootTypeName) throws IOException
rootTypeName
- Name of message type in schema definition that is
the root value to read/writeIOException
public ProtobufSchema load(File f) throws IOException
IOException
public ProtobufSchema load(File f, String rootTypeName) throws IOException
rootTypeName
- Name of message type in schema definition that is
the root value to read/writeIOException
public ProtobufSchema load(InputStream in) throws IOException
InputStream
will be closed before method returns.IOException
public ProtobufSchema load(InputStream in, String rootTypeName) throws IOException
rootTypeName
- Name of message type in schema definition that is
the root value to read/writeIOException
public ProtobufSchema load(Reader r) throws IOException
Reader
will be closed before method returns.IOException
public ProtobufSchema load(Reader r, String rootTypeName) throws IOException
rootTypeName
- Name of message type in schema definition that is
the root value to read/writeIOException
public ProtobufSchema parse(String schemaAsString) throws IOException
IOException
public ProtobufSchema parse(String schemaAsString, String rootTypeName) throws IOException
rootTypeName
- Name of message type in schema definition that is
the root value to read/writeIOException
public NativeProtobufSchema loadNative(File f) throws IOException
IOException
public NativeProtobufSchema loadNative(URL url) throws IOException
IOException
public NativeProtobufSchema parseNative(String schema) throws IOException
IOException
public NativeProtobufSchema loadNative(InputStream in, boolean close) throws IOException
IOException
protected NativeProtobufSchema loadNative(Reader r, boolean close) throws IOException
IOException
public com.squareup.protoparser.ProtoFile _loadNative(File f) throws IOException
IOException
public com.squareup.protoparser.ProtoFile _loadNative(URL url) throws IOException
IOException
public com.squareup.protoparser.ProtoFile _loadNative(String schemaAsString) throws IOException
IOException
public com.squareup.protoparser.ProtoFile _loadNative(InputStream in, boolean close) throws IOException
IOException
protected com.squareup.protoparser.ProtoFile _loadNative(Reader r, boolean close) throws IOException
IOException
protected String _readAll(Reader r) throws IOException
IOException
public void _throw(Exception e0) throws IOException
IOException
Copyright © 2020 FasterXML. All rights reserved.