legstar.test.jaxb.stru05.CobolStru05Record Maven / Gradle / Ivy
package legstar.test.jaxb.stru05;
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 CobolStru05Record extends CobolComplexType {
public CobolStru05Record() {
super(new CobolComplexType.Builder()
.name("Stru05Record")
.fields(createStru05RecordFields())
);
}
private static Map < String, CobolType > createComItemAFields() {
Map < String, CobolType > fields = new LinkedHashMap < String, CobolType >();
CobolPackedDecimalType < java.math.BigDecimal > comItemB =
new CobolPackedDecimalType.Builder < java.math.BigDecimal >(java.math.BigDecimal.class)
.totalDigits(7)
.fractionDigits(2)
.build();
fields.put("comItemB", comItemB);
return fields;
}
private static Map < String, CobolType > createComItemCFields() {
Map < String, CobolType > fields = new LinkedHashMap < String, CobolType >();
CobolBinaryType < Short > comItemB =
new CobolBinaryType.Builder < Short >(Short.class)
.signed(true)
.totalDigits(4)
.build();
fields.put("comItemB", comItemB);
return fields;
}
private static Map < String, CobolType > createComItemEFields() {
Map < String, CobolType > fields = new LinkedHashMap < String, CobolType >();
CobolStringType < String > comItemB =
new CobolStringType.Builder < String >(String.class)
.charNum(4)
.build();
fields.put("comItemB", comItemB);
return fields;
}
private static Map < String, CobolType > createComItemDFields() {
Map < String, CobolType > fields = new LinkedHashMap < String, CobolType >();
CobolComplexType comItemE = new CobolComplexType.Builder()
.name("ComItemE")
.fields(createComItemEFields())
.build();
fields.put("comItemE", comItemE);
return fields;
}
private static Map < String, CobolType > createStru05RecordFields() {
Map < String, CobolType > fields = new LinkedHashMap < String, CobolType >();
CobolComplexType comItemA = new CobolComplexType.Builder()
.name("ComItemA")
.fields(createComItemAFields())
.build();
fields.put("comItemA", comItemA);
CobolComplexType comItemC = new CobolComplexType.Builder()
.name("ComItemC")
.fields(createComItemCFields())
.build();
CobolArrayType comItemCArray = new CobolArrayType.Builder()
.itemType(comItemC)
.minOccurs(3)
.maxOccurs(3)
.build();
fields.put("comItemC", comItemCArray);
CobolComplexType comItemD = new CobolComplexType.Builder()
.name("ComItemD")
.fields(createComItemDFields())
.build();
fields.put("comItemD", comItemD);
return fields;
}
}