Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition


            {
               addVariableMappingMap(xm, jxtm, javaType);
            }

            // Add simple content if it exists
            XSSimpleTypeDefinition simple = xc.getSimpleType();
            if (simple != null)
            {
               addJavaXMLTypeMap(simple, xc.getName(), "", "", jwm, skipWrapperArray);
            }
View Full Code Here


   {
      for (int i = 0; i < attributes.getLength(); i++)
      {
         XSAttributeUse obj = (XSAttributeUse)attributes.item(i);
         XSAttributeDeclaration att = obj.getAttrDeclaration();
         XSSimpleTypeDefinition simple = att.getTypeDefinition();
         addJavaXMLTypeMap(simple, "none", "", "", jxtm.getJavaWsdlMapping(), true);
         VariableMapping vm = new VariableMapping(jxtm);
         String name = att.getName();
         vm.setXmlAttributeName(name);
         // JBWS-1170 Convert characters which are illegal in Java identifiers
View Full Code Here

        processPSVIAttributeWildcard(type.getAttributeWildcard());
        sendIndentedElement("psv:contentType");
        sendElementEvent(
            "psv:variety",
            this.translateContentType(type.getContentType()));
        XSSimpleTypeDefinition simpleType = type.getSimpleType();
        if(simpleType == null || (!simpleType.getAnonymous() || fDefined.contains(this.getID(simpleType)))) {
            processPSVIElementRef("psv:simpleTypeDefinition", simpleType);
        }
        else {
            processPSVISimpleTypeDefinition(simpleType);
        }
View Full Code Here

            }
        }
        if (type != base) {
            // If the base is a union, check if "derived" is allowed through any of the member types.
            if (base.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) base;
                if (st.getVariety() ==  XSSimpleTypeDefinition.VARIETY_UNION) {
                    XSObjectList memberTypes = st.getMemberTypes();
                    final int length = memberTypes.getLength();
                    for (int i = 0; i < length; ++i) {
                        if (typeDerivationOK(derived, (XSTypeDefinition) memberTypes.item(i), blockingConstraint)) {
                            return true;
                        }
View Full Code Here

        processPSVIAttributeWildcard(type.getAttributeWildcard());
        sendIndentedElement("psv:contentType");
        sendElementEvent(
            "psv:variety",
            this.translateContentType(type.getContentType()));
        XSSimpleTypeDefinition simpleType = type.getSimpleType();
        if(simpleType == null || (!simpleType.getAnonymous() || fDefined.contains(this.getID(simpleType)))) {
            processPSVIElementRef("psv:simpleTypeDefinition", simpleType);
        }
        else {
            processPSVISimpleTypeDefinition(simpleType);
        }
View Full Code Here

            }
        }
        if (type != base) {
            // If the base is a union, check if "derived" is allowed through any of the member types.
            if (base.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) base;
                if (st.getVariety() ==  XSSimpleTypeDefinition.VARIETY_UNION) {
                    XSObjectList memberTypes = st.getMemberTypes();
                    final int length = memberTypes.getLength();
                    for (int i = 0; i < length; ++i) {
                        if (typeDerivationOK(derived, (XSTypeDefinition) memberTypes.item(i), blockingConstraint)) {
                            return true;
                        }
View Full Code Here

   private static void bindAttributes(SchemaBinding doc,
                                      TypeBinding type,
                                      XSAttributeUse attrUse)
   {
      XSAttributeDeclaration attr = attrUse.getAttrDeclaration();
      XSSimpleTypeDefinition attrType = attr.getTypeDefinition();
      TypeBinding typeBinding = bindSimpleType(doc, attrType);
      QName attrName = new QName(attr.getNamespace(), attr.getName());
      AttributeBinding binding = type.addAttribute(attrName, typeBinding, RtAttributeHandler.INSTANCE);
      if( attrUse.getConstraintType() == XSConstants.VC_DEFAULT )
      {
         // Associate the default value with the binding
         binding.setDefaultConstraint(attrUse.getConstraintValue());
      }

      XSAnnotation an = attr.getAnnotation();
      if(an != null)
      {
         XsdAnnotation xsdAn = XsdAnnotation.unmarshal(an.getAnnotationString());
         XsdAppInfo appInfo = xsdAn.getAppInfo();
         if(appInfo != null)
         {
            PropertyMetaData propertyMetaData = appInfo.getPropertyMetaData();
            if(propertyMetaData != null)
            {
               binding.setPropertyMetaData(propertyMetaData);
            }

            boolean mapEntryKey = appInfo.isMapEntryKey();
            if(mapEntryKey)
            {
               binding.setMapEntryKey(mapEntryKey);
            }

            boolean mapEntryValue = appInfo.isMapEntryValue();
            if(mapEntryValue)
            {
               binding.setMapEntryValue(mapEntryValue);
            }
         }
      }

      if(log.isTraceEnabled())
      {
         String msg = "attribute " +
            new QName(attr.getNamespace(), attr.getName()) +
            ": ";

         if(binding.getPropertyMetaData() != null)
         {
            msg += " property=" +
               binding.getPropertyMetaData().getName() +
               ", collectionType=" + binding.getPropertyMetaData().getCollectionType();
         }
         else if(binding.isMapEntryKey())
         {
            msg += "bound as a key in a map entry";
         }
         else if(binding.isMapEntryValue())
         {
            msg += "bound as a value in a map entry";
         }
         else
         {
            msg += " type=" + attrType.getName() + ", owner type=" + type.getQName();
         }

         if(binding.getDefaultConstraint() != null)
         {
            msg += ", default=" + binding.getDefaultConstraint();
View Full Code Here

        }

        // If the content model of this complex type is simple, then we create a
        // PropDef corresponding to the XML text node defined by this content model.
        if (ctdef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
            XSSimpleTypeDefinition stdef = ctdef.getSimpleType();
            //set to non-mandatory, single-value property called "jcr:xmlcharacters"
            PropDef propDef = simpleTypeToPropDef(stdef, XML_CONTENT_PROPERTY_NAME, false, false);
            propDefList.add(propDef);

            // If the content model of this complex type is element or mixed then we must convert the
View Full Code Here

            XSTypeDefinition tDef = eDec.getTypeDefinition();

            // If this element declaration is of simple type
            // then it is converted into a property def
            if (tDef.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                XSSimpleTypeDefinition stDef = (XSSimpleTypeDefinition) tDef;
                PropDef propDef = simpleTypeToPropDef(stDef, name, mandatory, multiple);
                propDefList.add(propDef);

                // If this element declaration is of complex type then
                // it is converted into either node or property def
            } else if (tDef.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
                XSComplexTypeDefinition ctDef = (XSComplexTypeDefinition) tDef;

                // If the complex type definition contains a simple content model
                // and does not contain any attribute uses or attribute wildcards
                // then the enclosing element is converted to a property def
                if (ctDef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE &&
                        ctDef.getAttributeUses().getLength() == 0 && ctDef.getAttributeWildcard() == null) {
                    XSSimpleTypeDefinition std = ctDef.getSimpleType();
                    PropDef pd = simpleTypeToPropDef(std, name, mandatory, multiple);
                    propDefList.add(pd);

                    // If the complex type definition contains a complex content model
                    // or a simple content model with attribute uses or an attribute wildcard
View Full Code Here

        // Since this is an attribute declaration we assume it converts to
        // a single value property (we ignore the XML Schema List Type)
        boolean multiple = false;

        // Get the simple type def for this attribute
        XSSimpleTypeDefinition std = ad.getTypeDefinition();

        // convert it to a propdef
        return simpleTypeToPropDef(std, name, mandatory, multiple);
    }
View Full Code Here

TOP

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

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.