private void computeAllowedElements(ISchemaType type, HashSet elementSet) {
    if (type instanceof ISchemaComplexType) {
      ISchemaComplexType complexType = (ISchemaComplexType) type;
      ISchemaCompositor compositor = complexType.getCompositor();
      if (compositor != null) computeAllowedElements(compositor, elementSet);

      ISchemaAttribute[] attrs = complexType.getAttributes();
      for (int i = 0; i < attrs.length; i++) {
        if (attrs[i].getKind() == IMetaAttribute.JAVA) elementSet.add(attrs[i].getName());
      }
    }
  }
 private void computeAllowedElements(ISchemaCompositor compositor, HashSet elementSet) {
   ISchemaObject[] children = compositor.getChildren();
   for (int i = 0; i < children.length; i++) {
     ISchemaObject child = children[i];
     if (child instanceof ISchemaObjectReference) {
       ISchemaObjectReference ref = (ISchemaObjectReference) child;
       ISchemaElement refElement = (ISchemaElement) ref.getReferencedObject();
       if (refElement != null) elementSet.add(refElement.getName());
     } else if (child instanceof ISchemaCompositor) {
       computeAllowedElements((ISchemaCompositor) child, elementSet);
     }
   }
 }