public interface SerializationContext
SerializationContext
.Modifier and Type | Method and Description |
---|---|
boolean |
canMarshall(Class clazz)
Checks if the given type (message or enum) can be marshalled.
|
boolean |
canMarshall(String descriptorFullName)
Checks if the given type (message or enum) can be marshalled.
|
Configuration |
getConfiguration() |
EnumDescriptor |
getEnumDescriptor(String fullName) |
Map<String,FileDescriptor> |
getFileDescriptors()
Obtain the registered file descriptors.
|
<T> BaseMarshaller<T> |
getMarshaller(Class<T> clazz) |
<T> BaseMarshaller<T> |
getMarshaller(String descriptorFullName) |
Descriptor |
getMessageDescriptor(String fullName) |
Integer |
getTypeIdByName(String descriptorFullName)
Obtains the associated numeric type id, if one was defined.
|
String |
getTypeNameById(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(String name)
Unregisters a file.
|
Configuration getConfiguration()
void registerProtoFiles(FileDescriptorSource source) throws IOException, DescriptorParserException
IOException
DescriptorParserException
void unregisterProtoFile(String name)
Map<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(String fullName)
EnumDescriptor getEnumDescriptor(String fullName)
boolean canMarshall(Class clazz)
clazz
- the object or enum class to checktrue
if a marshaller exists, false
otherwiseboolean canMarshall(String descriptorFullName)
descriptorFullName
- the fully qualified name of the protobuf definition to checktrue
if a marshaller exists, false
otherwise<T> BaseMarshaller<T> getMarshaller(String descriptorFullName)
<T> BaseMarshaller<T> getMarshaller(Class<T> clazz)
String getTypeNameById(Integer typeId)
typeId
- the numeric type idIllegalArgumentException
- if the given type id is unknownInteger getTypeIdByName(String descriptorFullName)
descriptorFullName
- the fully qualified type namenull
if no type id is associated with the typeIllegalArgumentException
- if the given type name is unknownCopyright © 2016 JBoss, a division of Red Hat. All rights reserved.