Search in sources :

Example 1 with AsnCharacterString

use of com.beanit.asn1bean.compiler.model.AsnCharacterString in project jasn1 by openmuc.

the class BerClassWriter method getBerType.

private String getBerType(AsnType asnType) {
    String fullClassName = asnType.getClass().getName();
    String className = fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
    if (className.equals("AsnCharacterString")) {
        AsnCharacterString asnCharacterString = (AsnCharacterString) asnType;
        if (asnCharacterString.stringtype.equals("ISO646String")) {
            return "BerVisibleString";
        } else if (asnCharacterString.stringtype.equals("T61String")) {
            return "BerTeletexString";
        }
        return "Ber" + ((AsnCharacterString) asnType).stringtype;
    }
    return "Ber" + className.substring(3);
}
Also used : AsnCharacterString(com.beanit.asn1bean.compiler.model.AsnCharacterString) AsnCharacterString(com.beanit.asn1bean.compiler.model.AsnCharacterString) AsnOctetString(com.beanit.asn1bean.compiler.model.AsnOctetString) HexString(com.beanit.asn1bean.util.HexString) AsnBitString(com.beanit.asn1bean.compiler.model.AsnBitString)

Aggregations

AsnBitString (com.beanit.asn1bean.compiler.model.AsnBitString)1 AsnCharacterString (com.beanit.asn1bean.compiler.model.AsnCharacterString)1 AsnOctetString (com.beanit.asn1bean.compiler.model.AsnOctetString)1 HexString (com.beanit.asn1bean.util.HexString)1