public interface SerializationContext
SerializationContext.| Modifier and Type | Method and Description |
|---|---|
boolean |
canMarshall(java.lang.Class clazz)
Checks if the given type (message or enum) can be marshalled.
|
boolean |
canMarshall(java.lang.String descriptorFullName)
Checks if the given type (message or enum) can be marshalled.
|
Configuration |
getConfiguration() |
EnumDescriptor |
getEnumDescriptor(java.lang.String fullName) |
java.util.Map<java.lang.String,FileDescriptor> |
getFileDescriptors()
Obtain the registered file descriptors.
|
<T> BaseMarshaller<T> |
getMarshaller(java.lang.Class<T> clazz) |
<T> BaseMarshaller<T> |
getMarshaller(java.lang.String descriptorFullName) |
Descriptor |
getMessageDescriptor(java.lang.String fullName) |
java.lang.Integer |
getTypeIdByName(java.lang.String descriptorFullName)
Obtains the associated numeric type id, if one was defined.
|
java.lang.String |
getTypeNameById(java.lang.Integer typeId)
Obtains the type name associated with a numeric type id.
|
<T> void |
registerMarshaller(BaseMarshaller<T> marshaller)
Register a type marshaller.
|
void |
registerProtoFiles(FileDescriptorSource source) |
void |
unregisterProtoFile(java.lang.String name)
Unregisters a file.
|
Configuration getConfiguration()
void registerProtoFiles(FileDescriptorSource source) throws java.io.IOException, DescriptorParserException
java.io.IOExceptionDescriptorParserExceptionvoid unregisterProtoFile(java.lang.String name)
java.util.Map<java.lang.String,FileDescriptor> getFileDescriptors()
<T> void registerMarshaller(BaseMarshaller<T> marshaller)
T - the Java type of the object being handled by the marshallermarshaller - the marshaller instanceDescriptor getMessageDescriptor(java.lang.String fullName)
EnumDescriptor getEnumDescriptor(java.lang.String fullName)
boolean canMarshall(java.lang.Class clazz)
clazz - the object or enum class to checktrue if a marshaller exists, false otherwiseboolean canMarshall(java.lang.String descriptorFullName)
descriptorFullName - the fully qualified name of the protobuf definition to checktrue if a marshaller exists, false otherwise<T> BaseMarshaller<T> getMarshaller(java.lang.String descriptorFullName)
<T> BaseMarshaller<T> getMarshaller(java.lang.Class<T> clazz)
java.lang.String getTypeNameById(java.lang.Integer typeId)
typeId - the numeric type idjava.lang.IllegalArgumentException - if the given type id is unknownjava.lang.Integer getTypeIdByName(java.lang.String descriptorFullName)
descriptorFullName - the fully qualified type namenull if no type id is associated with the typejava.lang.IllegalArgumentException - if the given type name is unknown