// Path: fixb/src/main/java/org/fixb/FixConstants.java
// public static final int BEGIN_STRING_TAG = 8;
// 
// Path: fixb/src/main/java/org/fixb/FixConstants.java
// public static final int MSG_TYPE_TAG = 35;


import static org.fixb.FixConstants.BEGIN_STRING_TAG;
import static org.fixb.FixConstants.MSG_TYPE_TAG;
import com.google.common.collect.ImmutableMap;
import org.fixb.meta.*;
import quickfix.ConfigError;
import quickfix.DataDictionary;
import quickfix.FixVersions;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.StringWriter;
import java.util.LinkedHashMap;
import java.util.Map;
    }

    private static void writeFixPreambule(final XMLStreamWriter writer,
                                          final String fixProtocolVersion) throws XMLStreamException {
        final String[] tokens = fixProtocolVersion.split("\\.");
        if (tokens.length < 3) {
            throw new RuntimeException("Invalid FIX version: " + fixProtocolVersion);
        }
        writer.writeAttribute(PREAMBULE_TYPE, tokens[0]);
        writer.writeAttribute(VERSION_MAJOR, tokens[1]);
        writer.writeAttribute(VERSION_MINOR, tokens[2]);
    }

    private static void writeMessageXml(final XMLStreamWriter writer,
                                        final FixMessageMeta<?> message,
                                        final Map<FixFieldMeta, String> fields,
                                        final Map<Integer, String> fieldNames) throws XMLStreamException {
        writer.writeStartElement(MESSAGE);
        writer.writeAttribute(NAME, message.getType().getSimpleName());
        writer.writeAttribute(MSGTYPE, message.getMessageType());
        writer.writeAttribute(MSGCAT, MSGCAT_APP);
        writeComponentFields(writer, message, fields, fieldNames);
        writer.writeEndElement();
    }

    private static void writeComponentFields(final XMLStreamWriter writer,
                                             final FixBlockMeta<?> message,
                                             final Map<FixFieldMeta, String> fields,
                                             final Map<Integer, String> fieldNames) throws XMLStreamException {
        for (FixFieldMeta field : message.getFields()) {
// Path: fixb/src/main/java/org/fixb/FixConstants.java
// public static final int BEGIN_STRING_TAG = 8;
// 
// Path: fixb/src/main/java/org/fixb/FixConstants.java
// public static final int MSG_TYPE_TAG = 35;


// Path: fixb-quickfix/src/main/java/org/fixb/quickfix/FixMetaDataDictionary.java
import static org.fixb.FixConstants.BEGIN_STRING_TAG;
import static org.fixb.FixConstants.MSG_TYPE_TAG;
import com.google.common.collect.ImmutableMap;
import org.fixb.meta.*;
import quickfix.ConfigError;
import quickfix.DataDictionary;
import quickfix.FixVersions;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.StringWriter;
import java.util.LinkedHashMap;
import java.util.Map;

    }

    private static void writeFixPreambule(final XMLStreamWriter writer,
                                          final String fixProtocolVersion) throws XMLStreamException {
        final String[] tokens = fixProtocolVersion.split("\\.");
        if (tokens.length < 3) {
            throw new RuntimeException("Invalid FIX version: " + fixProtocolVersion);
        }
        writer.writeAttribute(PREAMBULE_TYPE, tokens[0]);
        writer.writeAttribute(VERSION_MAJOR, tokens[1]);
        writer.writeAttribute(VERSION_MINOR, tokens[2]);
    }

    private static void writeMessageXml(final XMLStreamWriter writer,
                                        final FixMessageMeta<?> message,
                                        final Map<FixFieldMeta, String> fields,
                                        final Map<Integer, String> fieldNames) throws XMLStreamException {
        writer.writeStartElement(MESSAGE);
        writer.writeAttribute(NAME, message.getType().getSimpleName());
        writer.writeAttribute(MSGTYPE, message.getMessageType());
        writer.writeAttribute(MSGCAT, MSGCAT_APP);
        writeComponentFields(writer, message, fields, fieldNames);
        writer.writeEndElement();
    }

    private static void writeComponentFields(final XMLStreamWriter writer,
                                             final FixBlockMeta<?> message,
                                             final Map<FixFieldMeta, String> fields,
                                             final Map<Integer, String> fieldNames) throws XMLStreamException {
        for (FixFieldMeta field : message.getFields()) {
            if (MSG_TYPE_TAG != field.getTag() && BEGIN_STRING_TAG != field.getTag()) {