Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSTypeDefinition


    /**
     * Return the most specific type below xsd:anySimpleType that this type is derived from.
     */
    private XSTypeDefinition getFoundingType() {
        XSTypeDefinition founding = typeDeclaration;
        XSTypeDefinition parent = founding.getBaseType();
        if ( parent == null )
            // it is xsd:anySimpleType
            return founding;
        while (parent.getBaseType() != null) {
            founding = parent;
            parent = parent.getBaseType();
        }
        return founding;
    }
View Full Code Here


    /**
     * @see org.apache.ode.utils.xsd.SchemaModel#isCompatible(javax.xml.namespace.QName,
     *      javax.xml.namespace.QName)
     */
    public boolean isCompatible(QName type1, QName type2) {
        XSTypeDefinition typeDef1;
        XSTypeDefinition typeDef2;

        if (knowsElementType(type1)) {
            typeDef1 = _model.getElementDeclaration(type1.getLocalPart(),
                    type1.getNamespaceURI())
                    .getTypeDefinition();
        } else if (knowsSchemaType(type1)) {
            typeDef1 = _model.getTypeDefinition(type1.getLocalPart(),
                    type1.getNamespaceURI());
        } else {
            throw new IllegalArgumentException("unknown schema type: " + type1);
        }

        if (knowsElementType(type2)) {
            typeDef2 = _model.getElementDeclaration(type2.getLocalPart(),
                    type2.getNamespaceURI())
                    .getTypeDefinition();
        } else if (knowsSchemaType(type2)) {
            typeDef2 = _model.getTypeDefinition(type2.getLocalPart(),
                    type2.getNamespaceURI());
        } else {
            throw new IllegalArgumentException("unknown schema type: " + type2);
        }

        return typeDef1.derivedFromType(typeDef2, (short)0)
                || typeDef2.derivedFromType(typeDef1, (short)0);
    }
View Full Code Here

     */
    public boolean isSimpleType(QName type) {
        if (type == null)
            throw new NullPointerException("Null type argument!");

        XSTypeDefinition typeDef = _model.getTypeDefinition(type.getLocalPart(),
                type.getNamespaceURI());

        return (typeDef != null)
                && (typeDef.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE);
    }
View Full Code Here

    Iterator i = wsdlDocument.getSchemas().values().iterator();
    while (i.hasNext())
    {
      XSModel xsModel = (XSModel) i.next();
      // Retrieving the derived type definition
      XSTypeDefinition xsType = xsModel.getTypeDefinition(
        extType.getLocalPart(), extType.getNamespaceURI());
      // If it is found and derived from the base type, return true
      if (xsType != null && xsType.derivedFrom(type.getNamespaceURI(),
        type.getLocalPart(), XSConstants.DERIVATION_NONE))
      {
        return true;
      }
    }
View Full Code Here

          // Going through the schemas
          Iterator it = schemas.values().iterator();
          while (it.hasNext())
          {
            XSModel xsModel = (XSModel) it.next();
            XSTypeDefinition xsType = null;
            // Getting the corresponding part type
            if (type == XSConstants.ELEMENT_DECLARATION)
            {
              // Getting schema element
              XSElementDeclaration elem = xsModel.getElementDeclaration(
                ref.getLocalPart(), ref.getNamespaceURI());
              if (elem != null)
              {
                // Getting element's type
                xsType = elem.getTypeDefinition();
                // If it is ref:swaRef
                if (WSIConstants.NS_URI_SWA_REF.equals(xsType.getName())
                  && WSIConstants.SCHEMA_TYPE_SWA_REF.equals(
                    xsType.getNamespace()))
                {
                  // Adding the name of the element to the list
                  swaRefs.add(
                    new QName(elem.getNamespace(), elem.getName()));
                }
View Full Code Here

    List swaRefs = new ArrayList();
    // If a term is an element declaration
    if (term.getType() == XSConstants.ELEMENT_DECLARATION)
    {
      XSElementDeclaration elem = (XSElementDeclaration) term;
      XSTypeDefinition xsType = elem.getTypeDefinition();
      // If element's type is ref:swaRef
      if (WSIConstants.NS_URI_SWA_REF.equals(xsType.getNamespace())
        && WSIConstants.SCHEMA_TYPE_SWA_REF.equals(xsType.getName()))
      {
        // Add element's name to the list
        swaRefs.add(
          new QName(elem.getNamespace(), elem.getName()));
      }
View Full Code Here

      // Going through the schemas
      Iterator it2 = schemas.values().iterator();
      while (it2.hasNext())
      {
        XSModel xsModel = (XSModel) it2.next();
        XSTypeDefinition partType = null;
        // Getting the corresponding part type
        if (type == XSConstants.ELEMENT_DECLARATION)
        {
          XSElementDeclaration elem = xsModel.getElementDeclaration(
            ref.getLocalPart(), ref.getNamespaceURI());
View Full Code Here

    if(tagList.contains(tagInfo)){
      return;
    }
    tagList.add(tagInfo);
   
    XSTypeDefinition type = element.getTypeDefinition();
    if(type instanceof XSComplexTypeDefinition){
      XSParticle particle = ((XSComplexTypeDefinition)type).getParticle();
      if(particle!=null){
        XSTerm term = particle.getTerm();
        if(term instanceof XSElementDeclaration){
View Full Code Here

      // An XOP parameter is detected if it is a complex type that derives from xsd:base64Binary
      WSDLTypes wsdlTypes = operation.getWsdlInterface().getWsdlDefinitions().getWsdlTypes();
      JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlTypes);
      String localPart = xmlType.getLocalPart() != null ? xmlType.getLocalPart() : "";
      String ns = xmlType.getNamespaceURI() != null ? xmlType.getNamespaceURI() : "";
      XSTypeDefinition xsType = schemaModel.getTypeDefinition(localPart, ns);
      XOPScanner scanner = new XOPScanner();
      if (scanner.findXOPTypeDef(xsType) != null | (localPart.equals("base64Binary") && ns.equals(Constants.NS_SCHEMA_XSD)))
      {
         // FIXME: read the xmime:contentType from the element declaration
         // See SchemaUtils#findXOPTypeDef(XSTypeDefinition typeDef) for details
View Full Code Here

      {
         QName xmlName = win.getElement();
         QName xmlType = win.getXMLType();
         String partName = win.getPartName();
         String wsdlMessageName = win.getMessageName().getLocalPart();
         XSTypeDefinition xt = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());

         boolean wrapped = isWrapped();

         if (wrapped)
         {
            wrapped = unwrapRequest(semm, wsdlMessageName, xmlName.getLocalPart(), xt);
         }

         if (wrapped == false)
         {
            if (xt instanceof XSSimpleTypeDefinition)
               xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);
            String paramMode = "IN";
            holder = output != null && xmlName.equals(output.getElement());
            if (holder == true)
            {
               paramMode = "INOUT";
            }

            mpin = getMethodParamPartsMapping(semm, xmlName, xmlType, 0, wsdlMessageName, paramMode, partName, false, true);
            semm.addMethodParamPartsMapping(mpin);
         }
      }

      if (holder == false && output != null)
      {
         QName xmlName = output.getElement();
         QName xmlType = output.getXMLType();
         boolean primitive = true;

         String targetNS = wsdlDefinitions.getTargetNamespace();
         QName messageName = new QName(targetNS, output.getMessageName().getLocalPart(), WSToolsConstants.WSTOOLS_CONSTANT_MAPPING_WSDL_MESSAGE_NS);

         String partName = output.getPartName();
         String containingElement = xmlName.getLocalPart();
         boolean array = false;
         XSTypeDefinition xt = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());

         ReturnTypeUnwrapper unwrapper = new ReturnTypeUnwrapper(xmlType, schemaModel, isWrapped());
         if (unwrapper.unwrap())
         {
            if (unwrapper.unwrappedElement != null)
            {
               XSElementDeclaration element = unwrapper.unwrappedElement;
               xt = element.getTypeDefinition();
               primitive = unwrapper.primitive;
               partName = element.getName();
               containingElement = containingElement + ToolsUtils.firstLetterUpperCase(unwrapper.unwrappedElement.getName());
               array = unwrapper.array;
               if (xt.getAnonymous())
               {
                  xmlType = new QName(containingElement);
               }
               else if (unwrapper.xmlType != null)
               {
                  xmlType = unwrapper.xmlType;
               }
            }
         }

         //Check it is a holder.
         if (wiop.getInputByPartName(xmlName.getLocalPart()) == null)
         {
            String nameSpace = null;
            if (xt != null)
            {
               nameSpace = xt.getNamespace();
            }
            if (xt instanceof XSSimpleTypeDefinition)
               xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);

            String javaType = getJavaTypeAsString(xmlName, xmlType, nameSpace, array, primitive);
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.