public final class SerializationContextImpl extends Object implements SerializationContext
SerializationContext.MarshallerProvider| Constructor and Description |
|---|
SerializationContextImpl(Configuration configuration) |
| 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.
|
<T> BaseMarshallerDelegate<T> |
getMarshallerDelegate(Class<T> javaClass) |
<T> BaseMarshallerDelegate<T> |
getMarshallerDelegate(String descriptorFullName) |
Descriptor |
getMessageDescriptor(String fullTypeName) |
Integer |
getTypeIdByName(String fullTypeName)
Obtains the associated numeric type id for a Protobuf type name, if a numeric id was defined.
|
String |
getTypeNameById(Integer typeId)
Obtains the Protobuf type name associated with a numeric type id.
|
void |
registerMarshaller(BaseMarshaller<?> marshaller)
Register a type marshaller.
|
void |
registerMarshallerProvider(SerializationContext.MarshallerProvider marshallerProvider) |
void |
registerProtoFiles(FileDescriptorSource source)
Register some proto schema definition files from a
FileDescriptorSource. |
void |
unregisterMarshaller(BaseMarshaller<?> marshaller) |
void |
unregisterMarshallerProvider(SerializationContext.MarshallerProvider marshallerProvider) |
void |
unregisterProtoFile(String fileName)
Unregisters a file.
|
public SerializationContextImpl(Configuration configuration)
public Configuration getConfiguration()
ImmutableSerializationContextgetConfiguration in interface ImmutableSerializationContextpublic Map<String,FileDescriptor> getFileDescriptors()
ImmutableSerializationContextgetFileDescriptors in interface ImmutableSerializationContextpublic Map<String,GenericDescriptor> getGenericDescriptors()
ImmutableSerializationContextgetGenericDescriptors in interface ImmutableSerializationContextpublic void registerProtoFiles(FileDescriptorSource source) throws DescriptorParserException
SerializationContextFileDescriptorSource.registerProtoFiles in interface SerializationContextDescriptorParserExceptionpublic void unregisterProtoFile(String fileName)
SerializationContextunregisterProtoFile in interface SerializationContextpublic Descriptor getMessageDescriptor(String fullTypeName)
getMessageDescriptor in interface ImmutableSerializationContextpublic EnumDescriptor getEnumDescriptor(String fullTypeName)
getEnumDescriptor in interface ImmutableSerializationContextpublic void registerMarshaller(BaseMarshaller<?> marshaller)
SerializationContextregisterMarshaller in interface SerializationContextmarshaller - the marshaller instancepublic void unregisterMarshaller(BaseMarshaller<?> marshaller)
unregisterMarshaller in interface SerializationContextpublic void registerMarshallerProvider(SerializationContext.MarshallerProvider marshallerProvider)
registerMarshallerProvider in interface SerializationContextpublic void unregisterMarshallerProvider(SerializationContext.MarshallerProvider marshallerProvider)
unregisterMarshallerProvider in interface SerializationContextpublic boolean canMarshall(Class<?> javaClass)
ImmutableSerializationContextcanMarshall in interface ImmutableSerializationContextjavaClass - the object or enum class to checktrue if a marshaller exists, false otherwisepublic boolean canMarshall(String fullTypeName)
ImmutableSerializationContextcanMarshall in interface ImmutableSerializationContextfullTypeName - the fully qualified name of the Protobuf definition to checktrue if a marshaller exists, false otherwisepublic <T> BaseMarshaller<T> getMarshaller(String fullTypeName)
ImmutableSerializationContextgetMarshaller in interface ImmutableSerializationContextfullTypeName - the type namepublic <T> BaseMarshaller<T> getMarshaller(Class<T> clazz)
ImmutableSerializationContextgetMarshaller in interface ImmutableSerializationContextclazz - the classpublic <T> BaseMarshallerDelegate<T> getMarshallerDelegate(String descriptorFullName)
public <T> BaseMarshallerDelegate<T> getMarshallerDelegate(Class<T> javaClass)
public String getTypeNameById(Integer typeId)
ImmutableSerializationContextgetTypeNameById in interface ImmutableSerializationContexttypeId - the numeric type idpublic Integer getTypeIdByName(String fullTypeName)
ImmutableSerializationContextgetTypeIdByName in interface ImmutableSerializationContextfullTypeName - the fully qualified type namenull if no type id is associated with the typepublic GenericDescriptor getDescriptorByName(String fullTypeName)
ImmutableSerializationContextgetDescriptorByName in interface ImmutableSerializationContextfullTypeName - the fully qualified type namepublic GenericDescriptor getDescriptorByTypeId(Integer typeId)
ImmutableSerializationContextgetDescriptorByTypeId in interface ImmutableSerializationContexttypeId - the numeric type idCopyright © 2020 JBoss, a division of Red Hat. All rights reserved.