private void componentScope(XSObject sourceComponent, List targetComponents) { switch (sourceComponent.getType()) { case XSConstants.ATTRIBUTE_DECLARATION: if (((XSAttributeDeclaration)sourceComponent).getScope() != XSConstants.SCOPE_GLOBAL) { XSObject type = ((XSAttributeDeclaration)sourceComponent).getEnclosingCTDefinition(); if (type != null && !targetComponents.contains(type)) { targetComponents.add(type); } } break; case XSConstants.ELEMENT_DECLARATION: if (((XSElementDeclaration)sourceComponent).getScope() != XSConstants.SCOPE_GLOBAL) { XSObject type = ((XSElementDeclaration)sourceComponent).getEnclosingCTDefinition(); if (type != null && !targetComponents.contains(type)) { targetComponents.add(type); } } break; } } // componentScope()
addComponent(((XSAttributeDeclaration)sourceComponent).getEnclosingCTDefinition(), nameTest, targetComponents);