All Downloads are FREE. Search and download functionalities are using the official Maven repository.

legstar.test.jaxb.flat02.CobolFlat02Record Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package legstar.test.jaxb.flat02;

import java.util.LinkedHashMap;
import java.util.Map;

import com.legstar.base.type.CobolType;
import com.legstar.base.type.composite.*;
import com.legstar.base.type.primitive.*;

public class CobolFlat02Record extends CobolComplexType {

    public CobolFlat02Record() {
        super(new CobolComplexType.Builder()
                    .name("Flat02Record")
                    .fields(createFlat02RecordFields())
              );
    }

    private static Map < String, CobolType > createFlat02RecordFields() {

        Map < String, CobolType > fields = new LinkedHashMap < String, CobolType >();

        CobolZonedDecimalType < Long > comNumber =
                new CobolZonedDecimalType.Builder < Long >(Long.class)
                        .totalDigits(6)
                        .build();
        fields.put("comNumber", comNumber);

        CobolStringType < String > comName =
                new CobolStringType.Builder < String >(String.class)
                        .charNum(20)
                        .build();
        fields.put("comName", comName);

        CobolPackedDecimalType < java.math.BigDecimal > comAmount =
                new CobolPackedDecimalType.Builder < java.math.BigDecimal >(java.math.BigDecimal.class)
                        .totalDigits(7)
                        .fractionDigits(2)
                        .build();
        fields.put("comAmount", comAmount);

        CobolBinaryType < Short > comArray =
                new CobolBinaryType.Builder < Short >(Short.class)
                        .signed(true)
                        .totalDigits(4)
                        .build();
        CobolArrayType comArrayArray = new CobolArrayType.Builder()
                        .itemType(comArray)
                        .minOccurs(5)
                        .maxOccurs(5)
                        .build();
        fields.put("comArray", comArrayArray);

        return fields;

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy