package org.etsi.its.tool.elvior;

import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.Value;
import org.etsi.ttcn.tri.TriMessage;


/**
 * 
 * Note that "Enable Internal Codec" field shall be set to true
 *
 */
public class LibItsMapemSpatem_asn1 extends LibIts_asn1 {
    
    /**
     * Constructor
     */
    public LibItsMapemSpatem_asn1() {
        _logger.entering("LibItsMapemSpatem_asn1", "LibItsMapemSpatem_asn1");
        _encodingName = "MAPEM_SPATEM_ETSI";
    }
    
    @Override
    public Value decode(final TriMessage message, final Type decodingHypothesis) {
        _logger.entering("LibItsMapemSpatem_asn1", "decode", decodingHypothesis.getName());
        
        if (decodingHypothesis.getName().endsWith("mapemPacket")) {
            Type type = getTypeForName("MAPEM_PDU_Descriptions.MAPEM");
            return super.decode(message, type);
        } else if (decodingHypothesis.getName().endsWith("spatemPacket")) {
            Type type = getTypeForName("SPATEM_PDU_Descriptions.SPATEM");
            return super.decode(message, type);
        }
        
        return super.decode(message, decodingHypothesis);
    }
    
} // End of class LibItsMapemSpatem_asn1 
