Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSTypeDefinition


      {
         String partName = part.getName();
         QName xmlName = new QName(partName);
         QName xmlType = part.getType();

         XSTypeDefinition xt = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
         if (xt instanceof XSSimpleTypeDefinition)
            xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);

         MethodParamPartsMapping mpin = getMethodParamPartsMapping(semm, xmlName, xmlType, i++, wsdlMessageName, getMode(wiop, part.getName()), partName, false, true);

         semm.addMethodParamPartsMapping(mpin);
      }

      WSDLRPCPart returnParameter = signature.returnParameter();
      if (returnParameter != null)
      {
         String partName = returnParameter.getName();
         QName xmlName = new QName(partName);
         QName xmlType = returnParameter.getType();

         XSTypeDefinition xt = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
         if (xt instanceof XSSimpleTypeDefinition)
            xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);

         WsdlReturnValueMapping wrvm = new WsdlReturnValueMapping(semm);
         wrvm.setMethodReturnValue(getJavaTypeAsString(xmlName, xmlType, false, true));
View Full Code Here


            WSDLInterfaceOperation op = ops[j];
            for (WSDLInterfaceOperationInput input : op.getInputs())
            {
               if (isDocStyle())
               {
                  XSTypeDefinition xt = getXSType(input);
                  // Don't unwrap the actual parameter.
                  addJavaXMLTypeMap(xt, input.getElement().getLocalPart(), "", "", jwm, false);
               }
               else
               {
                  for (WSDLRPCPart part : input.getChildParts())
                     addJavaXMLTypeMap(getXSType(part.getType()), input.getElement().getLocalPart(), "", "", jwm, true);
               }
            }

            for (WSDLInterfaceOperationOutput output : op.getOutputs())
            {
               if (isDocStyle())
               {
                  XSTypeDefinition xt = getXSType(output);
                  // Don't unwrap the response type.
                  addJavaXMLTypeMap(xt, output.getElement().getLocalPart(), "", "", jwm, false);
               }
               else
               {
                  for (WSDLRPCPart part : output.getChildParts())
                     addJavaXMLTypeMap(getXSType(part.getType()), output.getElement().getLocalPart(), "", "", jwm, true);
               }
            }

            for (WSDLInterfaceFault fault : wi.getFaults())
            {
               QName xmlType = fault.getXmlType();
               QName xmlName = fault.getElement();

               WSDLTypes types = wsdlDefinitions.getWsdlTypes();
               JBossXSModel xsmodel = WSDLUtils.getSchemaModel(types);
               XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
               addJavaXMLTypeMap(xt, xmlName.getLocalPart(), "", "", jwm, true);

               String exceptionType = getJavaTypeAsString(null, xmlType, false, true);

               if (registeredExceptions.contains(exceptionType) == false)
View Full Code Here

      {
         QName elementName = current.getElement();

         JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
         XSElementDeclaration xe = xsmodel.getElementDeclaration(elementName.getLocalPart(), elementName.getNamespaceURI());
         XSTypeDefinition xt = xe.getTypeDefinition();

         addJavaXMLTypeMap(xt, elementName.getLocalPart(), "", "", jwm, true);
      }
   }
View Full Code Here

               return false;
         }
         else if (term instanceof XSElementDeclaration)
         {
            XSElementDeclaration element = (XSElementDeclaration)term;
            XSTypeDefinition type = element.getTypeDefinition();

            QName xmlName = new QName(element.getNamespace(), element.getName());
            QName xmlType;
            if (type.getAnonymous())
            {
               String tempName = ToolsUtils.firstLetterUpperCase(containingElement) + ToolsUtils.firstLetterUpperCase(element.getName());
               xmlType = new QName(type.getNamespace(), tempName);
            }
            else
            {
               xmlType = new QName(type.getNamespace(), type.getName());
            }

            boolean array = particle.getMaxOccursUnbounded() || particle.getMaxOccurs() > 1;
            boolean primitive = !(element.getNillable() || (particle.getMinOccurs() == 0 && particle.getMaxOccurs() == 1));
View Full Code Here

            addGroup((XSModelGroup)xsterm, containingElement, containingType, jwm);
         }
         else if (xsterm instanceof XSElementDeclaration)
         {
            XSElementDeclaration xe = (XSElementDeclaration)xsterm;
            XSTypeDefinition typeDefinition = xe.getTypeDefinition();
            String tempContainingElement = "";
            String tempContainingType = "";
            if (xe.getScope() != XSConstants.SCOPE_GLOBAL)
            {
               tempContainingElement = containingElement;
View Full Code Here

      String arraySuffix = (array) ? "[]" : "";
      if (!isDocStyle())
      {
         JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
         XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());

         XSElementDeclaration unwrapped = SchemaUtils.unwrapArrayType(xt);
         StringBuilder builder = new StringBuilder();

         while (unwrapped != null)
         {
            xt = unwrapped.getTypeDefinition();
            primitive = !unwrapped.getNillable();
            builder.append("[]");
            unwrapped = SchemaUtils.unwrapArrayType(xt);
         }
         if (builder.length() > 0)
         {
            xmlType = new QName(xt.getNamespace(), xt.getName());
            arraySuffix = builder.toString();
         }
      }

      //First try to get it from the typeMapping
View Full Code Here

            ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
            if (elementPSVI != null) {
                if (fStorePSVI) {
                    ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
                }
                XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
                if (type == null) {
                    type = elementPSVI.getTypeDefinition();
                }
                ((ElementNSImpl)fCurrentNode).setType(type);
            }
View Full Code Here

           
            // 3. It has a [base type definition] whose value has a [base type definition]
            // whose value has that [name] and [target namespace], and so on following
            // the [base type definition] property recursively;
           
            XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
            if (typeDef != null) {
                typeDef = attrPSVI.getTypeDefinition();
            }
           
            //
View Full Code Here

    // 'variety' property
    short variety = simpleType.getVariety();
    printVariety(variety);

    //'base type definition' property
    XSTypeDefinition baseType = (XSTypeDefinition)simpleType.getBaseType() ;
    System.err.println("'base type definition' name \t: " + ( baseType != null ? baseType.getName() : "null" )   );
    System.err.println("'base type definition' target namespace : " + ( baseType != null ? baseType.getNamespace() : "null" )   );

    //check if base type is simple or complex
    if(baseType != null && (baseType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) ){
        //now we can get all the details of base type
        XSSimpleType simpleTypeDecl = (XSSimpleType)baseType;
    }

    // 'facets' property
View Full Code Here

           
            /** Add new top-level type definitions. **/
            map = newGrammar.getComponents(XSConstants.TYPE_DEFINITION);
            length = map.getLength();
            for (int i = 0; i < length; ++i) {
                XSTypeDefinition decl = (XSTypeDefinition) map.item(i);
                if (cachedGrammar.getGlobalTypeDecl(decl.getName()) == null) {
                    cachedGrammar.addGlobalTypeDecl(decl);
                }
            }
           
            /** Add new top-level attribute group definitions. **/
            map = newGrammar.getComponents(XSConstants.ATTRIBUTE_GROUP);
            length = map.getLength();
            for (int i = 0; i < length; ++i) {
                XSAttributeGroupDecl decl = (XSAttributeGroupDecl) map.item(i);
                if (cachedGrammar.getGlobalAttributeGroupDecl(decl.getName()) == null) {
                    cachedGrammar.addGlobalAttributeGroupDecl(decl);
                }
            }
           
            /** Add new top-level model group definitions. **/
            map = newGrammar.getComponents(XSConstants.MODEL_GROUP);
            length = map.getLength();
            for (int i = 0; i < length; ++i) {
                XSGroupDecl decl = (XSGroupDecl) map.item(i);
                if (cachedGrammar.getGlobalGroupDecl(decl.getName()) == null) {
                    cachedGrammar.addGlobalGroupDecl(decl);
                }
            }
           
            /** Add new top-level notation declarations. **/
            map = newGrammar.getComponents(XSConstants.NOTATION_DECLARATION);
            length = map.getLength();
            for (int i = 0; i < length; ++i) {
                XSNotationDecl decl = (XSNotationDecl) map.item(i);
                if (cachedGrammar.getGlobalNotationDecl(decl.getName()) == null) {
                    cachedGrammar.addGlobalNotationDecl(decl);
                }
            }
           
            /**
 
View Full Code Here

TOP

Related Classes of org.apache.xerces.xs.XSTypeDefinition

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.