void addInterfaces(List<InterfaceType> list) { List<InterfaceType> immediate = interfaces(); list.addAll(interfaces()); Iterator iter = immediate.iterator(); while (iter.hasNext()) { InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next(); interfaze.addSuperinterfaces(list); } ClassTypeImpl superclass = (ClassTypeImpl) superclass(); if (superclass != null) { superclass.addInterfaces(list); } }
boolean isAssignableTo(ReferenceType type) { ClassTypeImpl superclazz = (ClassTypeImpl) superclass(); if (this.equals(type)) { return true; } else if ((superclazz != null) && superclazz.isAssignableTo(type)) { return true; } else { List<InterfaceType> interfaces = interfaces(); Iterator iter = interfaces.iterator(); while (iter.hasNext()) { InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next(); if (interfaze.isAssignableTo(type)) { return true; } } return false; } }
void addVisibleMethods(Map<String, Method> methodMap) { /* * Add methods from * parent types first, so that the methods in this class will * overwrite them in the hash table */ Iterator iter = interfaces().iterator(); while (iter.hasNext()) { InterfaceTypeImpl interfaze = (InterfaceTypeImpl) iter.next(); interfaze.addVisibleMethods(methodMap); } ClassTypeImpl clazz = (ClassTypeImpl) superclass(); if (clazz != null) { clazz.addVisibleMethods(methodMap); } addToMethodMap(methodMap, methods()); }
@SuppressWarnings("unchecked") public DescriptionImpl( final URI baseURI, final TDefinitions definition, final NamespaceMapperImpl namespaceMapper, final SchemaLocatorImpl schemaLocator, final Map<FeatureConstants, Object> features, Map<URI, AbsItfDescription> descriptionImports, Map<URI, AbsItfSchema> schemaImports, WSDLReaderImpl reader) throws WSDLException, WSDLImportException { super(baseURI, definition, namespaceMapper, schemaLocator, features); // get the documentation this.documentation = new org.ow2.easywsdl.wsdl.impl.wsdl11.DocumentationImpl( this.model.getDocumentation(), this); // get the reader if (reader == null) { this.reader = new WSDLReaderImpl(); } else { this.reader = reader; } boolean find = false; for (final TDocumented part : this.model.getAnyTopLevelOptionalElement()) { // get imports if (part instanceof TImport) { final Import impt = new org.ow2.easywsdl.wsdl.impl.wsdl11.ImportImpl( (TImport) part, this, descriptionImports, schemaImports, this.documentURI, this.reader); this.imports.add(impt); find = true; } } if (!find) { Iterator<Object> it = this.model.getAny().iterator(); while (it.hasNext()) { Object part = it.next(); // get import if (part instanceof Element) { if ((((Element) part).getLocalName().equals("import")) && verifWSDL11Ns(((Element) part).getNamespaceURI())) { TImport tImpt = ImportImpl.replaceDOMElementByTImport(this, (Element) part, this.reader); it = this.model.getAny().iterator(); final Import impt = new org.ow2.easywsdl.wsdl.impl.wsdl11.ImportImpl( (TImport) tImpt, this, descriptionImports, schemaImports, this.documentURI, this.reader); this.imports.add(impt); } } } } this.addImportElementsInAllList(); this.addIncludeElementsInAllList(); find = false; for (final TDocumented part : this.model.getAnyTopLevelOptionalElement()) { // get types if (part instanceof TTypes) { this.types = new org.ow2.easywsdl.wsdl.impl.wsdl11.TypesImpl( (TTypes) part, this, schemaImports, this.reader); find = true; break; } } if (!find) { Iterator<Object> it = this.model.getAny().iterator(); while (it.hasNext()) { Object part = it.next(); // get import if (part instanceof Element) { if ((((Element) part).getLocalName().equals("types")) && verifWSDL11Ns(((Element) part).getNamespaceURI())) { if (reader == null) { reader = new WSDLReaderImpl(); } TTypes tTypes = TypesImpl.replaceDOMElementByTTypes(this, (Element) part, reader); it = this.model.getAny().iterator(); this.types = new org.ow2.easywsdl.wsdl.impl.wsdl11.TypesImpl( (TTypes) tTypes, this, schemaImports, this.reader); } } } } this.messages = this.findAllMessages(this); find = false; for (final TDocumented part : this.model.getAnyTopLevelOptionalElement()) { // get interfaces if (part instanceof TPortType) { final InterfaceType itf = new org.ow2.easywsdl.wsdl.impl.wsdl11.InterfaceTypeImpl((TPortType) part, this); this.interfaces.add(itf); find = true; } } if (!find) { Iterator<Object> it = this.model.getAny().iterator(); while (it.hasNext()) { Object part = it.next(); // get import if (part instanceof Element) { if ((((Element) part).getLocalName().equals("portType")) && verifWSDL11Ns(((Element) part).getNamespaceURI())) { if (reader == null) { reader = new WSDLReaderImpl(); } TPortType tPortType = InterfaceTypeImpl.replaceDOMElementByTPortType(this, (Element) part, reader); it = this.model.getAny().iterator(); final InterfaceType itf = new org.ow2.easywsdl.wsdl.impl.wsdl11.InterfaceTypeImpl( (TPortType) tPortType, this); this.interfaces.add(itf); } } } } find = false; for (final TDocumented part : this.model.getAnyTopLevelOptionalElement()) { // get bindings if (part instanceof TBinding) { final Binding b = new org.ow2.easywsdl.wsdl.impl.wsdl11.BindingImpl((TBinding) part, this); this.bindings.add(b); find = true; } } if (!find) { Iterator<Object> it = this.model.getAny().iterator(); while (it.hasNext()) { Object part = it.next(); // get import if (part instanceof Element) { if ((((Element) part).getLocalName().equals("binding")) && verifWSDL11Ns(((Element) part).getNamespaceURI())) { if (reader == null) { reader = new WSDLReaderImpl(); } TBinding tBinding = BindingImpl.replaceDOMElementByTBinding(this, (Element) part, reader); it = this.model.getAny().iterator(); final Binding b = new org.ow2.easywsdl.wsdl.impl.wsdl11.BindingImpl((TBinding) tBinding, this); this.bindings.add(b); } } } } find = false; for (final TDocumented part : this.model.getAnyTopLevelOptionalElement()) { // get services if (part instanceof TService) { final Service s = new org.ow2.easywsdl.wsdl.impl.wsdl11.ServiceImpl((TService) part, this); this.services.add(s); find = true; } } if (!find) { Iterator<Object> it = this.model.getAny().iterator(); while (it.hasNext()) { Object part = it.next(); // get import if (part instanceof Element) { if ((((Element) part).getLocalName().equals("service")) && verifWSDL11Ns(((Element) part).getNamespaceURI())) { if (reader == null) { reader = new WSDLReaderImpl(); } TService tService = ServiceImpl.replaceDOMElementByTService(this, (Element) part, reader); it = this.model.getAny().iterator(); final Service s = new org.ow2.easywsdl.wsdl.impl.wsdl11.ServiceImpl((TService) tService, this); this.services.add(s); } } } } }