FormatSchema implementation for protobuf, bound to specific root-level
ProtobufMessage, and useful for reading/writing protobuf content
that encodes instance of that message.
| Modifier and Type | Field and Description |
|---|---|
| protected final ProtobufMessage | |
| protected final NativeProtobufSchema | _source
In case we want to use a different root type, we'll also hold a reference to the native definition, if one is available. |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public List | getMessageTypes()
Accessor for listing names of all root-level messages defined in the original protoc. |
| public ProtobufMessage | getRootType()
Accessor for getting the default |
| public String | getSchemaType()
Implements com. Accessor to get type id for this |
| public NativeProtobufSchema | |
| public String | |
| public ProtobufSchema | withRootType(String typeName)
Method that can be called to choose different root type (of types defined in protoc); a new schema instance will be constructed if type is different from current root type. |
| _rootType | back to summary |
|---|---|
| protected final ProtobufMessage _rootType | |
| _source | back to summary |
|---|---|
| protected final NativeProtobufSchema _source In case we want to use a different root type, we'll also hold a reference to the native definition, if one is available. Note that it may be possible to construct instances directly, in which case this would be `null`. | |
| FORMAT_NAME_PROTOBUF | back to summary |
|---|---|
| public static final String FORMAT_NAME_PROTOBUF | |
| ProtobufSchema | back to summary |
|---|---|
| public ProtobufSchema(NativeProtobufSchema src, ProtobufMessage rootType) | |
| getMessageTypes | back to summary |
|---|---|
| public List Accessor for listing names of all root-level messages defined in the original protoc. | |
| getRootType | back to summary |
|---|---|
| public ProtobufMessage getRootType() Accessor for getting the default | |
| getSchemaType | back to summary |
|---|---|
| public String getSchemaType() Implements com. Accessor to get type id for this
| |
| getSource | back to summary |
|---|---|
| public NativeProtobufSchema getSource() Accessor for native representation of the protoc. Mostly useful for debugging; application code should not need to access this representation during normal operation. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| withRootType | back to summary |
|---|---|
| public ProtobufSchema withRootType(String typeName) throws IllegalArgumentException Method that can be called to choose different root type (of types defined in protoc); a new schema instance will be constructed if type is different from current root type. Note that cost of changing root type is non-trivial in that traversal of types defined is needed -- but exact cost depends on number of types defined. Since schema instances are immutable, it makes sense to try to reuse instances if possible.
| |