Rev

Rev 2500 | Details | Compare with Previous | Last modification | View Log | SVN | Bug Tracker

Rev Author Line No. Line
2467 garciay 1
package org.etsi.its.tool.elvior;
2
 
3
import org.etsi.ttcn.tci.Type;
4
import org.etsi.ttcn.tci.Value;
5
import org.etsi.ttcn.tri.TriMessage;
6
 
7
 
8
/**
9
 *
10
 * Note that "Enable Internal Codec" field shall be set to true
11
 *
12
 */
13
public class LibItsSremSsem_asn1 extends LibIts_asn1 {
14
 
15
    /**
16
     * Constructor
17
     */
18
    public LibItsSremSsem_asn1() {
19
        _logger.entering("LibItsSremSsem_asn1", "LibItsSremSsem_asn1");
20
        _encodingName = "SREM_SSEM_ETSI";
21
    }
22
 
23
    @Override
24
    public Value decode(final TriMessage message, final Type decodingHypothesis) {
25
        _logger.entering("LibItsSremSsem_asn1", "decode", decodingHypothesis.getName());
26
 
2500 garciay 27
        if (decodingHypothesis.getName().endsWith("SREM")) {
28
            Type type = getTypeForName("SREM_PDU_Descriptions.SREM");
2467 garciay 29
            return super.decode(message, type);
2500 garciay 30
        } else {
31
            Type type = getTypeForName("SSEM_PDU_Descriptions.SSEM");
2467 garciay 32
            return super.decode(message, type);
33
        }
2500 garciay 34
    }
35
 
36
    @Override
37
    public TriMessage encode(final Value template) {
38
        _logger.entering("LibItsSremSsem_asn1", "encode", template.getType().getName());
2467 garciay 39
 
2500 garciay 40
        TriMessage result;
41
        String type = String.format("%s.%s", _encodingName, template.getType().getName());
42
        if (template.getType().getName().endsWith("SREM")) {
43
                _encodingName = "SREM_PDU_Descriptions";
44
                result = super.encode(template);
45
        } else {
46
                _encodingName = "SREM_PDU_Descriptions";
47
                result = super.encode(template);
48
        }
49
        _encodingName = "SREM_SSEM_ETSI";
50
 
51
        return result;
2467 garciay 52
    }
53
 
54
} // End of class LibItsSremSsem_asn1