Exemple #1
0
    public IsoMessageDef build() {
      Encoding mtiEncoding =
          Encoding.valueOf(
              getMandatoryAttribute(
                  (Element) doc.getElementsByTagName(ELEMENT_MTI_ENCODING).item(0), ATTR_TYPE));
      NumericCodec mtiCodec = new NumericCodec(mtiEncoding, 4);
      LOG.info("MTI encoding: {}", mtiEncoding);

      CompositeDef headerDef = null;
      SortedMap<Integer, ComponentDef> headerComponents = buildHeaderComponents();
      if (headerComponents != null) {
        headerDef = new CompositeDef(headerComponents, new FixedCompositeCodec(), true);
      }

      Bitmap.Type msgBitmapType =
          Bitmap.Type.valueOf(
              getMandatoryAttribute(
                  (Element) doc.getElementsByTagName(ELEMENT_MSG_BITMAP).item(0), ATTR_TYPE));
      LOG.info("Bitmap type: {}", msgBitmapType);
      BitmapCodec msgBitmapCodec = new BitmapCodec(msgBitmapType);
      Map<Integer, CompositeDef> fieldsDef = buildFieldsDefs(msgBitmapCodec);

      buildFieldsDefsExtension(fieldsDef);

      return new IsoMessageDef(headerDef, mtiCodec, fieldsDef);
    }
Exemple #2
0
 public Bitmap.Type getBitmapType(Element e) {
   String value = getOptionalAttribute(e, ATTR_BITMAP_TYPE);
   return value != null ? Bitmap.Type.valueOf(value) : null;
 }