17
17
18
18
import org .agrona .*;
19
19
import org .agrona .generation .OutputManager ;
20
+ import org .agrona .sbe .*;
20
21
import uk .co .real_logic .sbe .PrimitiveType ;
21
22
import uk .co .real_logic .sbe .generation .CodeGenerator ;
22
23
import uk .co .real_logic .sbe .generation .Generators ;
@@ -48,11 +49,6 @@ enum CodecType
48
49
private static final String PACKAGE_INFO = "package-info" ;
49
50
private static final String BASE_INDENT = "" ;
50
51
private static final String INDENT = " " ;
51
- private static final String FLYWEIGHT = "Flyweight" ;
52
- private static final String COMPOSITE_DECODER_FLYWEIGHT = "CompositeDecoderFlyweight" ;
53
- private static final String COMPOSITE_ENCODER_FLYWEIGHT = "CompositeEncoderFlyweight" ;
54
- private static final String MESSAGE_DECODER_FLYWEIGHT = "MessageDecoderFlyweight" ;
55
- private static final String MESSAGE_ENCODER_FLYWEIGHT = "MessageEncoderFlyweight" ;
56
52
57
53
private final Ir ir ;
58
54
private final OutputManager outputManager ;
@@ -193,7 +189,7 @@ private void generateEncoder(
193
189
throws IOException
194
190
{
195
191
final String className = formatClassName (encoderName (msgToken .name ()));
196
- final String implementsString = implementsInterface (MESSAGE_ENCODER_FLYWEIGHT );
192
+ final String implementsString = implementsInterface (MessageEncoderFlyweight . class . getSimpleName () );
197
193
198
194
try (Writer out = outputManager .createOutput (className ))
199
195
{
@@ -220,7 +216,7 @@ private void generateDecoder(
220
216
throws IOException
221
217
{
222
218
final String className = formatClassName (decoderName (msgToken .name ()));
223
- final String implementsString = implementsInterface (MESSAGE_DECODER_FLYWEIGHT );
219
+ final String implementsString = implementsInterface (MessageDecoderFlyweight . class . getSimpleName () );
224
220
225
221
try (Writer out = outputManager .createOutput (className ))
226
222
{
@@ -1187,7 +1183,7 @@ private void generateBitSet(final List<Token> tokens) throws IOException
1187
1183
final String decoderName = decoderName (bitSetName );
1188
1184
final String encoderName = encoderName (bitSetName );
1189
1185
final List <Token > messageBody = getMessageBody (tokens );
1190
- final String implementsString = implementsInterface (FLYWEIGHT );
1186
+ final String implementsString = implementsInterface (Flyweight . class . getSimpleName () );
1191
1187
1192
1188
try (Writer out = outputManager .createOutput (decoderName ))
1193
1189
{
@@ -1261,7 +1257,7 @@ private void generateComposite(final List<Token> tokens) throws IOException
1261
1257
1262
1258
try (Writer out = outputManager .createOutput (decoderName ))
1263
1259
{
1264
- final String implementsString = implementsInterface (COMPOSITE_DECODER_FLYWEIGHT );
1260
+ final String implementsString = implementsInterface (CompositeDecoderFlyweight . class . getSimpleName () );
1265
1261
generateCompositeFlyweightHeader (
1266
1262
token , decoderName , out , readOnlyBuffer , fqReadOnlyBuffer , implementsString );
1267
1263
@@ -1309,7 +1305,7 @@ private void generateComposite(final List<Token> tokens) throws IOException
1309
1305
1310
1306
try (Writer out = outputManager .createOutput (encoderName ))
1311
1307
{
1312
- final String implementsString = implementsInterface (COMPOSITE_ENCODER_FLYWEIGHT );
1308
+ final String implementsString = implementsInterface (CompositeEncoderFlyweight . class . getSimpleName () );
1313
1309
generateCompositeFlyweightHeader (token , encoderName , out , mutableBuffer , fqMutableBuffer , implementsString );
1314
1310
1315
1311
for (int i = 1 , end = tokens .size () - 1 ; i < end ;)
0 commit comments