/** Recursively injects documentation to complex type attributes and it's parents. */ private void injectAttributesDocumentation( DomFinder domFinder, DocumentationEnricher documentationEnricher, File jsonFile, String type, Set<String> injectedTypes) throws XPathExpressionException, IOException { if (injectedTypes.contains(type)) { return; } injectedTypes.add(type); NodeList attributeElements = domFinder.findAttributesElements(type); if (attributeElements.getLength() > 0) { documentationEnricher.enrichTypeAttributesDocumentation(attributeElements, jsonFile); } String baseType = domFinder.findBaseType(type); if (baseType != null && !StringUtils.isEmpty(baseType)) { baseType = truncateTypeNamespace(baseType); injectAttributesDocumentation( domFinder, documentationEnricher, jsonFile, baseType, injectedTypes); } }