Source:
private void generateFieldClasses(Task task) throws ParserConfigurationException, SAXException, IOException { String outputDirectory = task.getOutputBaseDirectory() + "/" + task.getFieldDirectory() + "/"; logInfo(task.getName() + ": generating field classes in " + outputDirectory); writePackageDocumentation(outputDirectory, "FIX field definitions for " + task.getName()); Document document = getSpecification(task); List<String> fieldNames = getNames(document.getDocumentElement(), "fields/field"); try { Transformer transformer = createTransformer(task, "Fields.xsl"); for (String fieldName : fieldNames) { String outputFile = outputDirectory + fieldName + ".java"; if (!new File(outputFile).exists()) { logDebug("field: " + fieldName); Map<String, String> parameters = new HashMap<>(); parameters.put("fieldName", fieldName); parameters.put("fieldPackage", task.getFieldPackage()); String utcTimestampPrecision = task.getUtcTimestampPrecision(); if (utcTimestampPrecision != null) { String utcTimestampPrecisionParameterName = "utcTimestampPrecision"; if (!UTC_TIMESTAMP_PRECISION_ALLOWED_VALUES.contains(utcTimestampPrecision)) { throw new CodeGenerationException(new IllegalArgumentException(String.format( "Allowed values for parameter %s is %s. Supplied value: \"%s\".", utcTimestampPrecisionParameterName, String.join(", ", UTC_TIMESTAMP_PRECISION_ALLOWED_VALUES), utcTimestampPrecision ))); } parameters.put(utcTimestampPrecisionParameterName, utcTimestampPrecision); } if (task.isDecimalGenerated()) { parameters.put("decimalType", "java.math.BigDecimal"); parameters.put("decimalConverter", "Decimal"); } parameters.put(XSLPARAM_SERIAL_UID, SERIAL_UID_STR); generateCodeFile(task, document, parameters, outputFile, transformer); } } } catch (Exception e) { logError("error while generating field classes", e); } }

Target:
private void generateFieldClasses(Task task) throws ParserConfigurationException, SAXException, IOException { String outputDirectory = task.getOutputBaseDirectory() + "/" + task.getFieldDirectory() + "/"; logInfo(task.getName() + ": generating field classes in " + outputDirectory); writePackageDocumentation(outputDirectory, "FIX field definitions for " + task.getName()); Document document = getSpecification(task); List<String> fieldNames = getNames(document.getDocumentElement(), "fields/field"); try { Transformer transformer = createTransformer(task, "Fields.xsl"); for (String fieldName : fieldNames) { String outputFile = outputDirectory + fieldName + ".java"; if (!new File(outputFile).exists()) { logDebug("field: " + fieldName); Map<String, String> parameters = new HashMap<>(); parameters.put("fieldName", fieldName); parameters.put("fieldPackage", task.getFieldPackage()); String utcTimestampPrecision = task.getUtcTimestampPrecision(); if (utcTimestampPrecision != null) { String utcTimestampPrecisionParameterName = "utcTimestampPrecision"; if (!UTC_TIMESTAMP_PRECISION_ALLOWED_VALUES.contains(utcTimestampPrecision)) { throw new CodeGenerationException(new IllegalArgumentException(String.format( "Allowed values for parameter %s are %s. Supplied value: \"%s\".", utcTimestampPrecisionParameterName, String.join(", ", UTC_TIMESTAMP_PRECISION_ALLOWED_VALUES), utcTimestampPrecision ))); } parameters.put(utcTimestampPrecisionParameterName, utcTimestampPrecision); } if (task.isDecimalGenerated()) { parameters.put("decimalType", "java.math.BigDecimal"); parameters.put("decimalConverter", "Decimal"); } parameters.put(XSLPARAM_SERIAL_UID, SERIAL_UID_STR); generateCodeFile(task, document, parameters, outputFile, transformer); } } } catch (Exception e) { logError("error while generating field classes", e); } }