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.
|
Configuration |
getConfiguration()
Get the (immutable) configuration object that was used when creating this context.
|
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.
|
Map<String,GenericDescriptor> |
getGenericDescriptors()
Obtain the currently registered type 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() |
Configuration getConfiguration()
Map<String,FileDescriptor> getFileDescriptors()
Map<String,GenericDescriptor> getGenericDescriptors()
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 not known to this context<T> BaseMarshaller<T> getMarshaller(Class<T> clazz)
clazz - the classIllegalArgumentException - if the given Java type is not known to this context@Deprecated String getTypeNameById(Integer typeId)
getDescriptorByTypeId(typeId).getFullName()typeId - the numeric type idIllegalArgumentException - if the given type id is not known to this context@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 not known to this contextGenericDescriptor getDescriptorByTypeId(Integer typeId)
typeId - the numeric type idIllegalArgumentException - if the given type id is not known to this contextGenericDescriptor getDescriptorByName(String fullTypeName)
fullTypeName - the fully qualified type nameIllegalArgumentException - if the given type name is not known to this contextCopyright © 2020 JBoss, a division of Red Hat. All rights reserved.