ValidateVisitor { {{ private String errors = ""; }} before Schema {{ if (host.get_itemsListUnit().size() < 1) addError("Size (" + host.get_itemsListUnit().size() + ") of 'itemsListUnit' list cannot be less than 1"); }} before Documentation {{ int presentPartCount = 0; String presentParts = ""; if (host.get_nonEmptyDocumentation() != null) { presentPartCount++; presentParts = presentParts + " nonEmptyDocumentation"; } if (presentPartCount > 1) addError("Only one of these parts can be present in an element of type Documentation:\n" + " nonEmptyDocumentation\n" + " out of which these are present:" + presentParts + "."); }} before Attribute {{ int presentPartCount = 0; String presentParts = ""; if (host.get_nonEmptyAttribute() != null) { presentPartCount++; presentParts = presentParts + " nonEmptyAttribute"; } if (host.get_EmptyAttribute() != null) { presentPartCount++; presentParts = presentParts + " EmptyAttribute"; } if (presentPartCount > 1) addError("Only one of these parts can be present in an element of type Attribute:\n" + " nonEmptyAttribute, EmptyAttribute\n" + " out of which these are present:" + presentParts + "."); }} before Element {{ int presentPartCount = 0; String presentParts = ""; if (host.get_nonEmptyElement() != null) { presentPartCount++; presentParts = presentParts + " nonEmptyElement"; } if (host.get_EmptyElement() != null) { presentPartCount++; presentParts = presentParts + " EmptyElement"; } if (presentPartCount > 1) addError("Only one of these parts can be present in an element of type Element:\n" + " nonEmptyElement, EmptyElement\n" + " out of which these are present:" + presentParts + "."); }} before ComplexTypeContent {{ int presentPartCount = 0; String presentParts = ""; if (host.get_ComplexContent() != null) { presentPartCount++; presentParts = presentParts + " ComplexContent"; } if (host.get_SequenceGroup() != null) { presentPartCount++; presentParts = presentParts + " SequenceGroup"; } if (presentPartCount > 1) addError("Only one of these parts can be present in an element of type ComplexTypeContent:\n" + " ComplexContent, SequenceGroup\n" + " out of which these are present:" + presentParts + "."); }} public String get_return_val() {{ return errors; }} private void addError(String errorText) {{ errors = errors + "\n" + errorText; }} } // end of class ValidateVisitor