public interface ImmutableSerializationContext
SerializationContext
. The ImmutableSerializationContext
is a super-interface that contains strictly
read-only methods while its descendant SerializationContext
provides methods to mutate the context.Modifier and Type | Method and Description |
---|---|
boolean |
canMarshall(Class<?> javaClass)
Checks if the given type (message or enum) can be marshalled.
|
boolean |
canMarshall(String fullTypeName)
Checks if the given type (message or enum) can be marshalled.
|
GenericDescriptor |
getDescriptorByName(String fullTypeName)
Obtains the descriptor associated with a type name.
|
GenericDescriptor |
getDescriptorByTypeId(Integer typeId)
Obtains the descriptor associated with a numeric type id.
|
EnumDescriptor |
getEnumDescriptor(String fullTypeName) |
Map<String,FileDescriptor> |
getFileDescriptors()
Obtain the currently registered file descriptors.
|
<T> BaseMarshaller<T> |
getMarshaller(Class<T> clazz)
Obtains the marshaller associated with a Java type.
|
<T> BaseMarshaller<T> |
getMarshaller(String fullTypeName)
Obtains the marshaller associated with a Protobuf type name.
|
Descriptor |
getMessageDescriptor(String fullTypeName) |
Integer |
getTypeIdByName(String fullTypeName)
Deprecated.
replaced by
getDescriptorByName(fullTypeName).getTypeId() |
String |
getTypeNameById(Integer typeId)
Deprecated.
replaced by
getDescriptorByTypeId(typeId).getFullName() |
Map<String,FileDescriptor> getFileDescriptors()
Descriptor getMessageDescriptor(String fullTypeName)
IllegalArgumentException
- if the descriptor is not found or is not a messageEnumDescriptor getEnumDescriptor(String fullTypeName)
IllegalArgumentException
- if the descriptor is not found or is not an enumboolean canMarshall(Class<?> javaClass)
javaClass
- the object or enum class to checktrue
if a marshaller exists, false
otherwiseboolean canMarshall(String fullTypeName)
fullTypeName
- the fully qualified name of the Protobuf definition to checktrue
if a marshaller exists, false
otherwise<T> BaseMarshaller<T> getMarshaller(String fullTypeName)
fullTypeName
- the type nameIllegalArgumentException
- if the given type name is unknown<T> BaseMarshaller<T> getMarshaller(Class<T> clazz)
clazz
- the classIllegalArgumentException
- if the given Java type is unknown@Deprecated String getTypeNameById(Integer typeId)
getDescriptorByTypeId(typeId).getFullName()
typeId
- the numeric type idIllegalArgumentException
- if the given type id is unknown@Deprecated Integer getTypeIdByName(String fullTypeName)
getDescriptorByName(fullTypeName).getTypeId()
fullTypeName
- the fully qualified type namenull
if no type id is associated with the typeIllegalArgumentException
- if the given type name is unknownGenericDescriptor getDescriptorByTypeId(Integer typeId)
typeId
- the numeric type idIllegalArgumentException
- if the given type id is unknownGenericDescriptor getDescriptorByName(String fullTypeName)
fullTypeName
- the numeric type idIllegalArgumentException
- if the given type name is unknownCopyright © 2020 JBoss, a division of Red Hat. All rights reserved.