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 configuration.
|
GenericDescriptor |
getDescriptorByName(String fullTypeName) |
GenericDescriptor |
getDescriptorByTypeId(Integer typeId)
Obtains the type name 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) |
<T> BaseMarshaller<T> |
getMarshaller(String fullTypeName) |
<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, if one was defined.
|
String |
getTypeNameById(Integer typeId)
Obtains the 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()
SerializationContext
getConfiguration
in interface SerializationContext
public Map<String,FileDescriptor> getFileDescriptors()
ImmutableSerializationContext
getFileDescriptors
in interface ImmutableSerializationContext
public void registerProtoFiles(FileDescriptorSource source) throws DescriptorParserException
SerializationContext
FileDescriptorSource
.registerProtoFiles
in interface SerializationContext
DescriptorParserException
public void unregisterProtoFile(String fileName)
SerializationContext
unregisterProtoFile
in interface SerializationContext
public Descriptor getMessageDescriptor(String fullTypeName)
getMessageDescriptor
in interface ImmutableSerializationContext
public EnumDescriptor getEnumDescriptor(String fullTypeName)
getEnumDescriptor
in interface ImmutableSerializationContext
public void registerMarshaller(BaseMarshaller<?> marshaller)
SerializationContext
registerMarshaller
in interface SerializationContext
marshaller
- the marshaller instancepublic void unregisterMarshaller(BaseMarshaller<?> marshaller)
unregisterMarshaller
in interface SerializationContext
public void registerMarshallerProvider(SerializationContext.MarshallerProvider marshallerProvider)
registerMarshallerProvider
in interface SerializationContext
public void unregisterMarshallerProvider(SerializationContext.MarshallerProvider marshallerProvider)
unregisterMarshallerProvider
in interface SerializationContext
public boolean canMarshall(Class<?> javaClass)
ImmutableSerializationContext
canMarshall
in interface ImmutableSerializationContext
javaClass
- the object or enum class to checktrue
if a marshaller exists, false
otherwisepublic boolean canMarshall(String fullTypeName)
ImmutableSerializationContext
canMarshall
in interface ImmutableSerializationContext
fullTypeName
- the fully qualified name of the protobuf definition to checktrue
if a marshaller exists, false
otherwisepublic <T> BaseMarshaller<T> getMarshaller(String fullTypeName)
getMarshaller
in interface ImmutableSerializationContext
public <T> BaseMarshaller<T> getMarshaller(Class<T> clazz)
getMarshaller
in interface ImmutableSerializationContext
public <T> BaseMarshallerDelegate<T> getMarshallerDelegate(String descriptorFullName)
public <T> BaseMarshallerDelegate<T> getMarshallerDelegate(Class<T> javaClass)
public String getTypeNameById(Integer typeId)
ImmutableSerializationContext
getTypeNameById
in interface ImmutableSerializationContext
typeId
- the numeric type idpublic GenericDescriptor getDescriptorByName(String fullTypeName)
getDescriptorByName
in interface ImmutableSerializationContext
public GenericDescriptor getDescriptorByTypeId(Integer typeId)
ImmutableSerializationContext
getDescriptorByTypeId
in interface ImmutableSerializationContext
typeId
- the numeric type idpublic Integer getTypeIdByName(String fullTypeName)
ImmutableSerializationContext
getTypeIdByName
in interface ImmutableSerializationContext
fullTypeName
- the fully qualified type namenull
if no type id is associated with the typeCopyright © 2018 JBoss, a division of Red Hat. All rights reserved.