private static void addStructInheritance(DocumentmanagerConfig config, DocumentTypeManager manager) { for (int i = 0; i < config.datatype().size(); i++) { DocumentmanagerConfig.Datatype thisDataType = config.datatype(i); int id = thisDataType.id(); for (Object o : thisDataType.structtype()) { DocumentmanagerConfig.Datatype.Structtype struct = (DocumentmanagerConfig.Datatype.Structtype) o; StructDataType thisStruct = (StructDataType) manager.getDataType(id, ""); for (DocumentmanagerConfig.Datatype.Structtype.Inherits parent : struct.inherits()) { StructDataType parentStruct = (StructDataType) manager.getDataType(parent.name()); thisStruct.inherit(parentStruct); } } } } }
private static StructDataType handleStruct(NewDocumentType dt, SDDocumentType type) { StructDataType s = new StructDataType(type.getName()); for (Field f : type.getDocumentType().contentStruct().getFieldsThisTypeOnly()) { specialHandleAnnotationReference(dt, f); s.addField(f); } for (StructDataType inherited : type.getDocumentType().contentStruct().getInheritedTypes()) { s.inherit(inherited); } extractNestedTypes(dt, s); addType(dt, s); return s; }
StructDataType s = (StructDataType)dt.getDataType(e.getValue()); if (s != null) { e.getKey().inherit(s);