コード例 #1
0
  private boolean handlePortTypeOperation(TWSDLParserContext context, Operation parent, Element e) {
    context.push();
    context.registerNamespaces(e);
    JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));

    for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext(); ) {
      Element e2 = Util.nextElement(iter);
      if (e2 == null) {
        break;
      }

      if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) {
        parseWrapperStyle(context, jaxwsBinding, e2);
      } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) {
        parseAsynMapping(context, jaxwsBinding, e2);
      } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)) {
        parseMethod(context, jaxwsBinding, e2);
        if ((jaxwsBinding.getMethodName() != null)
            && (jaxwsBinding.getMethodName().getJavaDoc() != null)) {
          parent.setDocumentation(new Documentation(jaxwsBinding.getMethodName().getJavaDoc()));
        }
      } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PARAMETER)) {
        parseParameter(context, jaxwsBinding, e2);
      } else {
        Util.fail("parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI());
        return false;
      }
    }
    parent.addExtension(jaxwsBinding);
    context.pop();
    //        context.fireDoneParsingEntity(
    //                JAXWSBindingsConstants.JAXWS_BINDINGS,
    //                jaxwsBinding);
    return true;
  }
コード例 #2
0
  @Override
  public boolean handlePortExtension(
      TWSDLParserContext context, TWSDLExtensible parent, Element e) {
    if (XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)) {
      context.push();
      context.registerNamespaces(e);
      JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));

      for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext(); ) {
        Element e2 = Util.nextElement(iter);
        if (e2 == null) {
          break;
        }

        if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PROVIDER)) {
          parseProvider(context, jaxwsBinding, e2);
        } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)) {
          parseMethod(context, jaxwsBinding, e2);
          if ((jaxwsBinding.getMethodName() != null)
              && (jaxwsBinding.getMethodName().getJavaDoc() != null)) {
            ((Port) parent)
                .setDocumentation(new Documentation(jaxwsBinding.getMethodName().getJavaDoc()));
          }
        } else {
          Util.fail("parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI());
          return false;
        }
      }
      parent.addExtension(jaxwsBinding);
      context.pop();
      //            context.fireDoneParsingEntity(
      //                    JAXWSBindingsConstants.JAXWS_BINDINGS,
      //                    jaxwsBinding);
      return true;
    } else {
      Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
      return false;
    }
  }