protected static Field createField(ComplexType type, XSAttributeDecl element, Type fieldType, boolean isNillable) { String elementName = element.getName(); XmlString dv = element.getDefaultValue(); String defValue = null; if (dv != null) { defValue = dv.value; } int flags = 0; if (defValue == null) { dv = element.getFixedValue(); if (dv != null) { defValue = dv.value; flags |= Field.CONSTANT; } } Set<Constraint> constraints = new HashSet<>(); if (!isNillable) { constraints.add(NotNullConstraint.get()); } if (fieldType.isSimpleType()) { constraints.addAll(fieldType.getConstraints()); } return type.addField(elementName, fieldType, defValue, flags, constraints); }
constraints.addAll(st.getConstraints()); Field field = type.addField(elementName, fieldType, defValue, flags, constraints);
ct.addField(fieldName, listType, null, 0, null); } else { processModelGroup(schema, superType, name, ct, term.asModelGroup(), abstractType); maxOccur); ct.addField(element.getName(), listType, null, 0, null); ct.addField(parentField.getName().getLocalName(), parentField.getType(), (String) parentField.getDefaultValue(), 0, null);