// Path: fixb/src/main/java/org/fixb/FixException.java
// public class FixException extends RuntimeException {
//     private static final long serialVersionUID = 1;
// 
//     /**
//      * @param tag the field tag that has not been found
//      * @param fixMessage the FIX message that does not contain the tag
//      * @return an instance of FixException for a field-not-found case.
//      */
//     public static FixException fieldNotFound(int tag, String fixMessage) {
//         return new FixException("Field [" + tag + "] was not found in message: " + fixMessage);
//     }
// 
//     /**
//      * @param message the exception message
//      * @param cause the exception cause
//      */
//     public FixException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      * @param cause the exception cause
//      */
//     public FixException(final Throwable cause) {
//         super(cause.getMessage(), cause);
//     }
// 
//     /**
//      * @param message the exception message
//      */
//     public FixException(final String message) {
//         super(message);
//     }
// }
// 
// Path: fixb/src/main/java/org/fixb/FixSerializer.java
// public interface FixSerializer<M> {
//     /**
//      * Serializes the given object into FIX string.
//      *
//      * @param message a FIX object to serialize
//      * @return a generated FIX message
//      */
//     String serialize(M message);
// 
//     /**
//      * Deserializes the given FIX string into an object of the given type.
//      *
//      * @param fixMessage a FIX message to read
//      * @return an object of the type M populated with the values from the given FIX message.
//      */
//     M deserialize(String fixMessage);
// }
// 
// Path: fixb/src/main/java/org/fixb/meta/FixMetaDictionary.java
// public interface FixMetaDictionary extends FixEnumDictionary {
//     /**
//      * @return all FixMessageMetas registered with the FixMetaDictionary singleton
//      */
//     Collection<FixMessageMeta<?>> getAllMessageMetas();
// 
//     /**
//      * @return a FixMessageMeta for the given class. If meta has not been previously registered with this dictionary
//      *         it will be collected from the given class definition using {@link FixMetaScanner}.
//      * @throws IllegalStateException if no meta instance found.
//      * @see FixMetaScanner
//      */
//     <T> FixMessageMeta<T> getMetaForClass(Class<T> type);
// 
//     /**
//      * @return a FixMessageMeta for the given FIX message type.
//      * @throws IllegalStateException if no meta instance found.
//      */
//     <T> FixMessageMeta<T> getMetaForMessageType(String fixMessageType);
// }


import org.fixb.FixException;
import org.fixb.FixSerializer;
import org.fixb.meta.FixMetaDictionary;
import quickfix.ConfigError;
import quickfix.DataDictionary;
import quickfix.InvalidMessage;
import quickfix.Message;
/*
 * Copyright 2013 YTEQ Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.fixb.quickfix;


/**
 * An implementation of FixSerializer that is used to serialize/deserialize quickfix.Message objects.
 *
 * @author vladyslav.yatsenko
 */
public class QuickFixSerializer implements FixSerializer<Message> {
    private final DataDictionary dataDictionary;

// Path: fixb/src/main/java/org/fixb/FixException.java
// public class FixException extends RuntimeException {
//     private static final long serialVersionUID = 1;
// 
//     /**
//      * @param tag the field tag that has not been found
//      * @param fixMessage the FIX message that does not contain the tag
//      * @return an instance of FixException for a field-not-found case.
//      */
//     public static FixException fieldNotFound(int tag, String fixMessage) {
//         return new FixException("Field [" + tag + "] was not found in message: " + fixMessage);
//     }
// 
//     /**
//      * @param message the exception message
//      * @param cause the exception cause
//      */
//     public FixException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      * @param cause the exception cause
//      */
//     public FixException(final Throwable cause) {
//         super(cause.getMessage(), cause);
//     }
// 
//     /**
//      * @param message the exception message
//      */
//     public FixException(final String message) {
//         super(message);
//     }
// }
// 
// Path: fixb/src/main/java/org/fixb/FixSerializer.java
// public interface FixSerializer<M> {
//     /**
//      * Serializes the given object into FIX string.
//      *
//      * @param message a FIX object to serialize
//      * @return a generated FIX message
//      */
//     String serialize(M message);
// 
//     /**
//      * Deserializes the given FIX string into an object of the given type.
//      *
//      * @param fixMessage a FIX message to read
//      * @return an object of the type M populated with the values from the given FIX message.
//      */
//     M deserialize(String fixMessage);
// }
// 
// Path: fixb/src/main/java/org/fixb/meta/FixMetaDictionary.java
// public interface FixMetaDictionary extends FixEnumDictionary {
//     /**
//      * @return all FixMessageMetas registered with the FixMetaDictionary singleton
//      */
//     Collection<FixMessageMeta<?>> getAllMessageMetas();
// 
//     /**
//      * @return a FixMessageMeta for the given class. If meta has not been previously registered with this dictionary
//      *         it will be collected from the given class definition using {@link FixMetaScanner}.
//      * @throws IllegalStateException if no meta instance found.
//      * @see FixMetaScanner
//      */
//     <T> FixMessageMeta<T> getMetaForClass(Class<T> type);
// 
//     /**
//      * @return a FixMessageMeta for the given FIX message type.
//      * @throws IllegalStateException if no meta instance found.
//      */
//     <T> FixMessageMeta<T> getMetaForMessageType(String fixMessageType);
// }


// Path: fixb-quickfix/src/main/java/org/fixb/quickfix/QuickFixSerializer.java
import org.fixb.FixException;
import org.fixb.FixSerializer;
import org.fixb.meta.FixMetaDictionary;
import quickfix.ConfigError;
import quickfix.DataDictionary;
import quickfix.InvalidMessage;
import quickfix.Message;

/*
 * Copyright 2013 YTEQ Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.fixb.quickfix;


/**
 * An implementation of FixSerializer that is used to serialize/deserialize quickfix.Message objects.
 *
 * @author vladyslav.yatsenko
 */
public class QuickFixSerializer implements FixSerializer<Message> {
    private final DataDictionary dataDictionary;

    public QuickFixSerializer(final String fixVersion, FixMetaDictionary fixMetaDictionary) {