Package org.jboss.ws.tools

Examples of org.jboss.ws.tools.XSDTypeToJava


   public void generateJavaSourceFileForRequestResponseStruct(File location, ServiceEndpointInterfaceMapping seim, JBossXSModel xsmodel, String typeNamespace)
         throws IOException
   {
      WSDLUtils utils = WSDLUtils.getInstance();
      XSDTypeToJava xst = new XSDTypeToJava(namespacePackageMap);
      xst.setTypeMapping(this.typeMapping);
      xst.setPackageName(getPackageName(typeNamespace));
      ServiceEndpointMethodMapping[] mapArr = seim.getServiceEndpointMethodMappings();
      int len = mapArr != null ? mapArr.length : 0;
      for (int i = 0; i < len; i++)
      {
         ServiceEndpointMethodMapping mm = mapArr[i];
         String opname = mm.getJavaMethodName();
         String sei = seim.getServiceEndpointInterface();
         String plainClassName = utils.getJustClassName(sei);
         String classname = plainClassName + "_" + opname + "_RequestStruct";
         List<VAR> listInputs = new ArrayList<VAR>();
         MethodParamPartsMapping[] mppmarr = mm.getMethodParamPartsMappings();
         int lenmppmarr = mppmarr != null ? mppmarr.length : 0;
         for (int j = 0; j < lenmppmarr; j++)
         {
            listInputs.addAll(xst.getVARList((XSComplexTypeDefinition)xsmodel.getTypeDefinition(opname, typeNamespace), xsmodel, false));
         }
         JavaWriter jw = new JavaWriter();
         jw.createJavaFile(location, classname, getPackageName(typeNamespace), listInputs, null, null, false, null);
         classname = plainClassName + "_" + opname + "_ResponseStruct";
         XSTypeDefinition xt = xsmodel.getTypeDefinition(opname + "Response", typeNamespace);
         List<VAR> listOutputs = new ArrayList<VAR>();
         if (xt instanceof XSSimpleTypeDefinition)
         {
            listOutputs.add(new VAR(Constants.DEFAULT_RPC_RETURN_NAME, xt.getName(), false));
         }
         else listOutputs.addAll(xst.getVARList((XSComplexTypeDefinition)xt, xsmodel, false));
         jw.createJavaFile(location, classname, getPackageName(typeNamespace), listOutputs, null, null, false, null);
      }
   }
View Full Code Here


/*     */
/*     */   public void generateJavaSourceFileForRequestResponseStruct(File location, ServiceEndpointInterfaceMapping seim, JBossXSModel xsmodel, String typeNamespace)
/*     */     throws IOException
/*     */   {
/* 194 */     WSDLUtils utils = WSDLUtils.getInstance();
/* 195 */     XSDTypeToJava xst = new XSDTypeToJava();
/* 196 */     xst.setTypeMapping(this.typeMapping);
/* 197 */     xst.setPackageName(this.packageName);
/* 198 */     ServiceEndpointMethodMapping[] mapArr = seim.getServiceEndpointMethodMappings();
/* 199 */     int len = mapArr != null ? mapArr.length : 0;
/* 200 */     for (int i = 0; i < len; i++)
/*     */     {
/* 202 */       ServiceEndpointMethodMapping mm = mapArr[i];
/* 203 */       String opname = mm.getJavaMethodName();
/* 204 */       String sei = seim.getServiceEndpointInterface();
/* 205 */       String plainClassName = WSDLUtils.getJustClassName(sei);
/* 206 */       String classname = plainClassName + "_" + opname + "_RequestStruct";
/* 207 */       List listInputs = new ArrayList();
/* 208 */       MethodParamPartsMapping[] mppmarr = mm.getMethodParamPartsMappings();
/* 209 */       int lenmppmarr = mppmarr != null ? mppmarr.length : 0;
/* 210 */       for (int j = 0; j < lenmppmarr; j++)
/*     */       {
/* 212 */         listInputs.addAll(xst.getVARList((XSComplexTypeDefinition)xsmodel.getTypeDefinition(opname, typeNamespace), xsmodel, false));
/*     */       }
/* 214 */       JavaWriter jw = new JavaWriter();
/* 215 */       jw.createJavaFile(location, classname, this.packageName, listInputs, null, null, false, null);
/* 216 */       classname = plainClassName + "_" + opname + "_ResponseStruct";
/* 217 */       XSTypeDefinition xt = xsmodel.getTypeDefinition(opname + "Response", typeNamespace);
/* 218 */       List listOutputs = new ArrayList();
/* 219 */       if ((xt instanceof XSSimpleTypeDefinition))
/*     */       {
/* 221 */         listOutputs.add(new XSDTypeToJava.VAR("result", xt.getName(), false));
/*     */       }
/* 223 */       else listOutputs.addAll(xst.getVARList((XSComplexTypeDefinition)xt, xsmodel, false));
/* 224 */       jw.createJavaFile(location, classname, this.packageName, listOutputs, null, null, false, null);
/*     */     }
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.ws.tools.XSDTypeToJava

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.