CROM parent_crom=map.get(parent);
CROM crom=new CROM(parent_crom, true, s.getName(), -1, CromType.CROM_t_Text);
if(parent_crom==null){
crom.addType(CROM.CROM_t_Root);
}
CROM_ext ext=crom.getExtension();
String del=Utils.getDelimiterString(text);
ext.setDelimiter(del);
ext.setStrQual(text.getStringQualifier());
Field identifier=s.findIdentField();
if(identifier!=null && isFixedField){
ext.setIdentPos(identifier.getBeginPosition());
ext.setIdentLength(identifier.getLength());
}
if(root!=null && !bExtDefinedForRoot){
ext=root.getExtension();
ext.setDelimiter(del);
ext.setStrQual(text.getStringQualifier());
if(identifier!=null && isFixedField){
ext.setIdentPos(identifier.getBeginPosition());
ext.setIdentLength(identifier.getLength());
}
bExtDefinedForRoot=true;
}
map.put(s, crom);
if(parent==null)root=crom;
switch (s.getOccurenceID()) {
case 1:
crom.setOneToOneNode();
break;
case 2:
crom.setAtLeastOneNode();
break;
case 3:
crom.setOptionalNode();
break;
case 4:
crom.setOuterJoin();
break;
}
for (Field f : s.getFieldList()) {
CROM field=new CROM(crom, false, f.fieldName, -1, CromType.CROM_t_Text);
field.setValueType(f.dataType);
if(f.equals(identifier)){
field.addType(CROM.CROM_t_Attribute);
}
else {
field.addType(CROM.CROM_t_Attribute | CROM.CROM_t_Optional);
}
if(f.defaultValue!=null && f.defaultValue.length()>0){
field.setDefaultValue(f.defaultValue);
field.addType(CROM.CROM_t_HasDefault);
}
ext=field.getExtension();
ext.setFormat(f.format);
if(isFixedField){
ext.setFieldPos((short)f.getBeginPosition());
ext.setFieldLength((short)f.getLength());
}
}
}
MappingTreeStructure structure = new CromBasedMappingTreeStructure(root, new CROMHeader("Text"));
if (callback != null) {