Examples of XSElementDeclaration


Examples of org.apache.xerces.xs.XSElementDeclaration

      List tagList = (List)nsTagListMap.get(targetNS);
//      root = null;
     
      XSNamedMap map = grammer.getComponents(XSConstants.ELEMENT_DECLARATION);
      for(int i=0;i<map.getLength();i++){
        XSElementDeclaration element = (XSElementDeclaration)map.item(i);
        parseXSDElement(tagList,element);
      }
    } catch(Exception ex){
     
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSElementDeclaration

            if(in!=null){
              SchemaGrammar grammer = (SchemaGrammar)new XMLSchemaLoader().loadGrammar(
                  new XMLInputSource(null,null,null,in,null));
              XSNamedMap map = grammer.getComponents(XSConstants.ELEMENT_DECLARATION);
              for(int i=0;i<map.getLength();i++){
                XSElementDeclaration element = (XSElementDeclaration)map.item(i);
                comboDocumentRoot.add(element.getName());
              }
            }
          }
        } catch(Exception ex){
          HTMLPlugin.openAlertDialog(ex.toString());
View Full Code Here

Examples of org.apache.xerces.xs.XSElementDeclaration

            //Get the main fault from the wsdlInterface
            WSDLInterfaceFault intfFault = fault.getWsdlInterfaceOperation().getWsdlInterface().getFault(faultName);
            JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
            QName faultXMLName = intfFault.getElement();
            QName faultXMLType = intfFault.getXmlType();
            XSElementDeclaration xe = xsmodel.getElementDeclaration(faultXMLName.getLocalPart(), faultXMLName.getNamespaceURI());
            XSTypeDefinition xt = xe.getTypeDefinition();
            if (!xt.getAnonymous())
               xt = xsmodel.getTypeDefinition(xt.getName(), xt.getNamespace());
            if (xt instanceof XSComplexTypeDefinition)
               generateJavaSource((XSComplexTypeDefinition)xt, xsmodel, faultXMLName.getLocalPart(), true);
View Full Code Here

Examples of org.apache.xerces.xs.XSElementDeclaration

   private void appendHeaderParameter(StringBuilder buf, WSDLSOAPHeader header, boolean holder) throws IOException
   {
      QName elementName = header.getElement();

      JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
      XSElementDeclaration xe = xsmodel.getElementDeclaration(elementName.getLocalPart(), elementName.getNamespaceURI());
      XSTypeDefinition xt = xe.getTypeDefinition();
      WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
      QName xmlType = wsdlTypes.getXMLType(header.getElement());

      // Replace the xt with the real type from the schema.
      xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());

      if (buf.length() > 0)
      {
         buf.append(", ");
      }

      generateParameter(buf, xe.getName(), xmlType, xsmodel, xt, false, true, holder);
      buf.append(" ").append(header.getPartName());
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSElementDeclaration

         else if (term instanceof XSElementDeclaration)
         {
            if (buf.length() > 0)
               buf.append(", ");

            XSElementDeclaration element = (XSElementDeclaration)term;
            XSTypeDefinition type = element.getTypeDefinition();
            String tempContainingElement = containingElement + ToolsUtils.firstLetterUpperCase(element.getName());

            QName xmlType = null;
            if (type.getAnonymous() == false)
               xmlType = new QName(type.getNamespace(), type.getName());

            JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
            boolean array = particle.getMaxOccursUnbounded() || particle.getMaxOccurs() > 1;
            boolean primitive = !(element.getNillable() || (particle.getMinOccurs() == 0 && particle.getMaxOccurs() == 1));
            generateParameter(buf, tempContainingElement, xmlType, xsmodel, type, array, primitive, false);

            String paramName;
            if (type.getAnonymous())
            {
               paramName = containingElement;
            }
            else
            {
               paramName = element.getName();
            }

            buf.append(" ").append(getMethodParam(paramName));
         }
      }
View Full Code Here

Examples of org.apache.xerces.xs.XSElementDeclaration

         if (xt instanceof XSComplexTypeDefinition)
            generateJavaSource((XSComplexTypeDefinition)xt, xsmodel, containingElement);

         if (unwrapper.unwrappedElement != null)
         {
            XSElementDeclaration element = unwrapper.unwrappedElement;
            xt = element.getTypeDefinition();
            primitive = unwrapper.primitive;

            if (unwrapper.xmlType != null)
               xmlType = unwrapper.xmlType;
View Full Code Here

Examples of org.apache.xerces.xs.XSElementDeclaration

      public boolean unwrap()
      {
         if (!Constants.DOCUMENT_LITERAL.equals(style))
         {
            XSElementDeclaration unwrapped = SchemaUtils.unwrapArrayType(xt);
            StringBuilder builder = new StringBuilder();
            while (unwrapped != null)
            {
               xt = unwrapped.getTypeDefinition();
               nillable = unwrapped.getNillable();
               builder.append("[]");
               unwrapped = SchemaUtils.unwrapArrayType(xt);
            }
            if (builder.length() > 0)
            {
View Full Code Here

Examples of org.apache.xerces.xs.XSElementDeclaration

         }

         namedMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
         for (int i = 0; i < namedMap.getLength(); i++)
         {
            XSElementDeclaration element = (XSElementDeclaration)namedMap.item(i);
            analyzeElement(element, null, element.getNamespace(), null, null);
         }
         processed.clear();
      }
View Full Code Here

Examples of org.apache.xerces.xs.XSElementDeclaration

               XSObjectList list = group.getParticles();
               for (int i = 0; i < list.getLength(); i++)
                  analyzeParticle((XSParticle)list.item(i), parentName, namespace);
               break;
            case XSConstants.ELEMENT_DECLARATION:
               XSElementDeclaration decl = (XSElementDeclaration)term;
               analyzeElement(decl, parentName, namespace, new Integer(particle.getMinOccurs()), new Integer(particle.getMaxOccurs()));
         }
      }
View Full Code Here

Examples of org.apache.xerces.xs.XSElementDeclaration

      {
         vars.addAll(createVARsforXSModelGroup((XSModelGroup)xsterm, schema, origType));
         return vars;
      }

      XSElementDeclaration elem = (XSElementDeclaration)xsterm;

      //    TODO: Check if the element contains any anon complex type
      //    TODO: If yes, create class that is ComplexTypeName+ElementName
      //    TODO: ItemsItem  If the elem contains anon simpletype
      //    TODO: No need to create seperate Java class

      String tname = elem.getName();
      XSTypeDefinition xstypedef = elem.getTypeDefinition();

      String xstypename = xstypedef.getName();
      // Check if it is a composite type
      if (xstypename != null && xstypedef.getName().equals(origType.getName()) && xstypedef.getNamespace().equals(origType.getNamespace()))
      {
         // it is a composite type
         QName qn = new QName(origType.getNamespace(), origType.getName());
         VAR vr = createVAR(qn, elem, (XSComplexTypeDefinition)xstypedef, tname, getPackageName(origType.getNamespace()), arrayType);
         vars.add(vr);
         return vars;
      }
      else

      if (xstypename == null && xstypedef instanceof XSComplexTypeDefinition)
      {
         XSComplexTypeDefinition xsc = (XSComplexTypeDefinition)xstypedef;
         String subname = utils.firstLetterUpperCase(tname);
         // Save the fname in a temp var
         String tempfname = this.fname;
         // it will be an anonymous type
         if (containingElement == null || containingElement.length() == 0)
            containingElement = origType.getName();

         String anonName;
         if (elem.getScope() == XSConstants.SCOPE_GLOBAL)
         {
            anonName = subname;
         }
         else
         {
            anonName = containingElement + subname;
         }

         anonName = utils.firstLetterUpperCase(anonName);
         this.fname = anonName;

         if (!generatedFiles.contains(this.fname))
         {
            generatedFiles.add(this.fname);
            this.createJavaFile((XSComplexTypeDefinition)xstypedef, schema, false);
         }

         // Restore the fname
         this.fname = tempfname;
         // Bypass rest of processing
         QName anonqn = new QName(anonName);
         VAR vr = createVAR(anonqn, elem, xsc, tname, getPackageName(xsc.getNamespace()), arrayType);
         vars.add(vr);
         return vars;
      }
      else
      {
         String temp = this.fname;
         // Unwrap any array wrappers
         if (SchemaUtils.isWrapperArrayType(xstypedef))
         {
            XSComplexTypeDefinition complex = (XSComplexTypeDefinition)xstypedef;
            XSModelGroup group = (XSModelGroup)complex.getParticle().getTerm();
            XSElementDeclaration element = (XSElementDeclaration)((XSParticle)group.getParticles().item(0)).getTerm();
            xstypedef = element.getTypeDefinition();
            xstypename = xstypedef.getName();
            arrayType = true;
         }

         QName qn = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.