Implementations of the MessageDef interface are generated for Proto messages.
Objects are generated instead of classes for all the implementations of MessageField, MessageOneof, and MessageDef interfaces.
A mini-framework for code generation is implemented, providing a flexible way to change the contents of the generated files.
A message builder extension is generated returning the corresponding MessageDef implementation.
The project is migrated to the latest version of ProtoData 0.60.2.
The implementation of the MessageDef interface for some Proto message looks like the following:
public object IpAddressDef : MessageDef<IpAddress> {
public val ipv4: IpAddressIpv4Field = IpAddressIpv4Field
public val ipv6: IpAddressIpv6Field = IpAddressIpv6Field
public val `value`: IpAddressValueOneof = IpAddressValueOneof
public override val fields: Collection<MessageField<IpAddress, out Any>> = listOf(
ipv4,
ipv6)
public override val oneofs: Collection<MessageOneof<IpAddress>> = listOf(
value)
}
This PR includes the following tasks done:
MessageDef
interface are generated for Proto messages.MessageField
,MessageOneof
, andMessageDef
interfaces.MessageDef
implementation.0.60.2
.The implementation of the
MessageDef
interface for some Proto message looks like the following: