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
IOExceptionpublic ProtobufSchema load(URL url, String rootTypeName) throws IOException
rootTypeName - Name of message type in schema definition that is
the root value to read/writeIOExceptionpublic ProtobufSchema load(File f) throws IOException
IOExceptionpublic ProtobufSchema load(File f, String rootTypeName) throws IOException
rootTypeName - Name of message type in schema definition that is
the root value to read/writeIOExceptionpublic ProtobufSchema load(InputStream in) throws IOException
InputStream will be closed before method returns.IOExceptionpublic ProtobufSchema load(InputStream in, String rootTypeName) throws IOException
rootTypeName - Name of message type in schema definition that is
the root value to read/writeIOExceptionpublic ProtobufSchema load(Reader r) throws IOException
Reader will be closed before method returns.IOExceptionpublic ProtobufSchema load(Reader r, String rootTypeName) throws IOException
rootTypeName - Name of message type in schema definition that is
the root value to read/writeIOExceptionpublic ProtobufSchema parse(String schemaAsString) throws IOException
IOExceptionpublic ProtobufSchema parse(String schemaAsString, String rootTypeName) throws IOException
rootTypeName - Name of message type in schema definition that is
the root value to read/writeIOExceptionpublic NativeProtobufSchema loadNative(File f) throws IOException
IOExceptionpublic NativeProtobufSchema loadNative(URL url) throws IOException
IOExceptionpublic NativeProtobufSchema parseNative(String schema) throws IOException
IOExceptionpublic NativeProtobufSchema loadNative(InputStream in, boolean close) throws IOException
IOExceptionprotected NativeProtobufSchema loadNative(Reader r, boolean close) throws IOException
IOExceptionpublic com.squareup.protoparser.ProtoFile _loadNative(File f) throws IOException
IOExceptionpublic com.squareup.protoparser.ProtoFile _loadNative(URL url) throws IOException
IOExceptionpublic com.squareup.protoparser.ProtoFile _loadNative(String schemaAsString) throws IOException
IOExceptionpublic com.squareup.protoparser.ProtoFile _loadNative(InputStream in, boolean close) throws IOException
IOExceptionprotected com.squareup.protoparser.ProtoFile _loadNative(Reader r, boolean close) throws IOException
IOExceptionprotected String _readAll(Reader r) throws IOException
IOExceptionpublic void _throw(Exception e0) throws IOException
IOExceptionCopyright © 2021 FasterXML. All rights reserved.