public final class SerializationContextImpl extends Object implements SerializationContext
| Constructor and Description |
|---|
SerializationContextImpl(Configuration configuration) |
| 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) |
<T> BaseMarshallerDelegate<T> |
getMarshallerDelegate(Class<T> clazz) |
<T> BaseMarshallerDelegate<T> |
getMarshallerDelegate(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 fileName)
Unregisters a file.
|
public SerializationContextImpl(Configuration configuration)
public Configuration getConfiguration()
getConfiguration in interface SerializationContextpublic Map<String,FileDescriptor> getFileDescriptors()
SerializationContextgetFileDescriptors in interface SerializationContextpublic void registerProtoFiles(FileDescriptorSource source) throws IOException, DescriptorParserException
registerProtoFiles in interface SerializationContextIOExceptionDescriptorParserExceptionpublic void unregisterProtoFile(String fileName)
SerializationContextunregisterProtoFile in interface SerializationContextpublic Descriptor getMessageDescriptor(String fullName)
getMessageDescriptor in interface SerializationContextpublic EnumDescriptor getEnumDescriptor(String fullName)
getEnumDescriptor in interface SerializationContextpublic <T> void registerMarshaller(BaseMarshaller<T> marshaller)
SerializationContextregisterMarshaller in interface SerializationContextT - the Java type of the object being handled by the marshallermarshaller - the marshaller instancepublic boolean canMarshall(Class clazz)
SerializationContextcanMarshall in interface SerializationContextclazz - the object or enum class to checktrue if a marshaller exists, false otherwisepublic boolean canMarshall(String descriptorFullName)
SerializationContextcanMarshall in interface SerializationContextdescriptorFullName - the fully qualified name of the protobuf definition to checktrue if a marshaller exists, false otherwisepublic <T> BaseMarshaller<T> getMarshaller(String descriptorFullName)
getMarshaller in interface SerializationContextpublic <T> BaseMarshaller<T> getMarshaller(Class<T> clazz)
getMarshaller in interface SerializationContextpublic <T> BaseMarshallerDelegate<T> getMarshallerDelegate(String descriptorFullName)
public <T> BaseMarshallerDelegate<T> getMarshallerDelegate(Class<T> clazz)
public String getTypeNameById(Integer typeId)
SerializationContextgetTypeNameById in interface SerializationContexttypeId - the numeric type idpublic Integer getTypeIdByName(String descriptorFullName)
SerializationContextgetTypeIdByName in interface SerializationContextdescriptorFullName - the fully qualified type namenull if no type id is associated with the typeCopyright © 2025 JBoss, a division of Red Hat. All rights reserved.