public static List getInheritedXSDElementsAndAttributes(XSDComplexTypeDefinition complexType) { List result = new ArrayList(); XSDTypeDefinition parent = complexType.getBaseTypeDefinition(); if (parent instanceof XSDComplexTypeDefinition && complexType.isSetDerivationMethod()) { // order switched, from the XSDUtils version result.addAll(getInheritedXSDElementsAndAttributes((XSDComplexTypeDefinition) parent)); result.addAll(XSDUtils.getXSDElementsAndAttributes((XSDComplexTypeDefinition) parent)); } return result; }
protected void addComplexTypeContent(XSDComplexTypeDefinition complexType, Vector<TreeNode> v) { List attrs = getInheritedXSDElementsAndAttributes(complexType); attrs.addAll(XSDUtils.getXSDElementsAndAttributes(complexType)); for (Iterator it = attrs.iterator(); it.hasNext(); ) { Object attr = it.next(); if (attr instanceof XSDAttributeDeclaration) { v.add(new XSDAttributeDeclarationTreeNode((XSDAttributeDeclaration) attr, isCondensed)); } else if (attr instanceof XSDElementDeclaration) { v.add(new XSDElementDeclarationTreeNode((XSDElementDeclaration) attr, isCondensed)); } else if (attr instanceof XSDComplexTypeDefinition) { v.add(new XSDTypeDefinitionTreeNode((XSDComplexTypeDefinition) attr, isCondensed)); } } }
protected boolean complexTypeHasChildren(XSDComplexTypeDefinition complexType) { if (!XSDUtils.getXSDElementsAndAttributes(complexType).isEmpty()) return true; if (!getInheritedXSDElementsAndAttributes(complexType).isEmpty()) return true; return false; }