package com.brilliance.isc.swift.objmtconvert.model.mt2xx.tag.tag204;

import com.brilliance.isc.swift.objmtconvert.annotation.TagRegex;
import com.brilliance.isc.swift.objmtconvert.model.AbsMTCreator;
import com.brilliance.isc.swift.objmtconvert.model.AbsTagCreate;
import com.brilliance.isc.swift.objmtconvert.model.mt2xx.MT204Creator;

import java.lang.reflect.Field;
import java.math.BigDecimal;

/**
 * @Description：
 * @Author：夏猛
 * @CreateTime：2023/2/27 10:43
 **/
public class Tag19Creator extends AbsTagCreate {
    private MT204Creator mt204Creator;

    public Tag19Creator(AbsMTCreator absMTCreator)
    {
        super(absMTCreator);
        this.mt204Creator= (MT204Creator) absMTCreator;
    }

    public  void creator()
    {
//        for(Field field:MT204Creator.class.getDeclaredFields()){
//            //立一
//            String method = "get" + field.getName();
//            //反射获取值
//            Object val;
//            TagRegex annotation = field.getAnnotation(TagRegex.class);
//            validate(val,annotation.value());
//        }
        BigDecimal tag19Value = mt204Creator.getSumofAmounts();
        mt204Creator.set("19", tag19Value);
    }
}