@@ -78,8 +78,8 @@ public class CodeGeneratorJ {
78
78
public static final int GRP_MSG_TYPE_GRP = 2098 ;
79
79
80
80
private static final int FAIL_STATUS = 1 ;
81
- private static final String DOUBLE_FIELD = "DoubleField" ;
82
- private static final String DECIMAL_FIELD = "DecimalField" ;
81
+ public static final String DOUBLE_FIELD = "DoubleField" ;
82
+ public static final String DECIMAL_FIELD = "DecimalField" ;
83
83
84
84
private static final String FIXT_1_1 = "FIXT.1.1" ;
85
85
@@ -91,7 +91,9 @@ public class CodeGeneratorJ {
91
91
private static final String FIELD_PACKAGE = "quickfix.field" ;
92
92
93
93
private static final long SERIALIZATION_VERSION = 552892318L ;
94
-
94
+ public static final String UTC_DATE_ONLY = "UTCDateOnly" ;
95
+ public static final String UTC_DATE_ONLY_FIELD = "UtcDateOnlyField" ;
96
+
95
97
private boolean isGenerateBigDecimal = true ;
96
98
private boolean isGenerateOnlySession = false ;
97
99
private boolean isExcludeSession = false ;
@@ -430,6 +432,7 @@ private static void generateField(File outputDir,
430
432
String decimalTypeString ) throws IOException {
431
433
final String name = toTitleCase (fieldType .getName ());
432
434
final File file = getClassFilePath (outputDir , packageName , name );
435
+ System .out .printf ("Generating Field file : %s.%n" , file .getName ());
433
436
try (FileWriter writer = new FileWriter (file )) {
434
437
writeFileHeader (writer );
435
438
writePackage (writer , packageName );
@@ -459,6 +462,9 @@ private static void generateField(File outputDir,
459
462
writeFieldNoArgConstructor (writer , name , fieldId );
460
463
writeFieldArgConstructor (writer , name , fieldId , baseClassname , isGenerateBigDecimal );
461
464
writeEndClassDeclaration (writer );
465
+ } catch (Exception e ) {
466
+ System .err .printf ("Exception generating file : %s.%n" , file .getName ());
467
+ e .printStackTrace ();
462
468
}
463
469
}
464
470
@@ -519,6 +525,7 @@ private static void generateMessage(File outputDir,
519
525
messageClassname = messageClassname + toTitleCase (scenario );
520
526
}
521
527
final File file = getClassFilePath (outputDir , messagePackage , messageClassname );
528
+ System .out .printf ("Generating Message file : %s.%n" , file .getName ());
522
529
try (FileWriter writer = new FileWriter (file )) {
523
530
writeFileHeader (writer );
524
531
writePackage (writer , messagePackage );
@@ -540,6 +547,9 @@ private static void generateMessage(File outputDir,
540
547
writeMemberAccessors (writer , members , messagePackage , componentPackage , groups , components , fields );
541
548
542
549
writeEndClassDeclaration (writer );
550
+ } catch (Exception e ) {
551
+ System .err .printf ("Exception generating file : %s.%n" , file .getName ());
552
+ e .printStackTrace ();
543
553
}
544
554
}
545
555
@@ -671,7 +681,7 @@ private static File getClassFilePath(File outputDir, String packageName, String
671
681
return new File (outputDir , sb .toString ());
672
682
}
673
683
674
- private static String getFieldBaseClass (String type , String decimalTypeString ) {
684
+ public static String getFieldBaseClass (String type , String decimalTypeString ) {
675
685
String baseType ;
676
686
switch (type ) {
677
687
case "char" :
@@ -698,8 +708,8 @@ private static String getFieldBaseClass(String type, String decimalTypeString) {
698
708
case "UTCTimeOnly" :
699
709
baseType = "UtcTimeOnlyField" ;
700
710
break ;
701
- case "UTCDateOnly" :
702
- baseType = "UtcDateOnlyField" ;
711
+ case UTC_DATE_ONLY :
712
+ baseType = UTC_DATE_ONLY_FIELD ;
703
713
break ;
704
714
case "Boolean" :
705
715
baseType = "BooleanField" ;
@@ -855,9 +865,6 @@ private static Writer writeFieldArgConstructor(Writer writer,
855
865
case "UtcDateOnlyField" :
856
866
writer .write (String .format ("%n%spublic %s(LocalDate data) {%n%ssuper(%d, data);%n%s}%n" , CodeGeneratorUtil .indent (1 ),
857
867
className , CodeGeneratorUtil .indent (2 ), fieldId , CodeGeneratorUtil .indent (1 )));
858
- // added for compatibility with existing QFJ tests
859
- writer .write (String .format ("%n%spublic %s(String data) {%n%ssuper(%d, data);%n%s}%n" , CodeGeneratorUtil .indent (1 ), className ,
860
- CodeGeneratorUtil .indent (2 ), fieldId , CodeGeneratorUtil .indent (1 )));
861
868
break ;
862
869
case "UtcTimeOnlyField" :
863
870
writer .write (String .format ("%n%spublic %s(LocalTime data) {%n%ssuper(%d, data);%n%s}%n" , CodeGeneratorUtil .indent (1 ),
0 commit comments