Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition


        // handle attributes
        if (attributesRequired) {
            String attrDataParaName = getConfig().getAttributeDataParameterName();
            List<XSAttributeUse> attributeUses = Util.collectAttributeUses(element);
            for (XSAttributeUse attrUse : attributeUses) {
                XSSimpleTypeDefinition attrType = Util.getType(attrUse);
                String attrName = Util.getAttributeOriginalName(attrUse, getConfig());
                attrName = Util.updateAttributeNameWithNamespace(element.getNamespace(), attrUse, attrName);
                String value = attrDataParaName + "."
                        + Util.replaceCharactersForbiddenInCppIdentifiers(Util.getAttributeName(attrUse, getConfig()));
                switch (Util.findVariety(attrType)) {
View Full Code Here


    /**
     * Prints code which prints data with variety list.
     */
    protected void printDataList(XSSimpleTypeDefinition simpleType, String value, String length) {
        XSSimpleTypeDefinition itemType = simpleType.getItemType();
        if (Util.findVariety(itemType) == Variety.UNION) {
            fprintfSourceFile.print(getConfig().getIndentation());
            fprintfSourceFile.println("for (size_t i=0; i<" + length + "; ++i) {");
            fprintfSourceFile.print(getConfig().getIndentation());
            fprintfSourceFile.print(getConfig().getIndentation());
View Full Code Here

    @Override
    protected void printDataMethodImpl(String methodName, String parameterList, String cppElementName,
            XSElementDeclaration element) {
        fprintfSourceFile.println("{");

        XSSimpleTypeDefinition simpleType = Util.findSimpleTypeDefinition(element.getTypeDefinition());
        if (simpleType != null) {
            String value = getConfig().getConvenienceDataMethodValueParameterName();
            String length = getConfig().getConvenienceDataMethodLengthParameterName();
            switch (Util.findVariety(simpleType)) {
            case ATOMIC:
View Full Code Here

      {
         // Simple types are not neccessary mapped in jaxrpc-mapping.xml, lazily add the mapping here
         XSTypeDefinition xsType = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
         if (xsType instanceof XSSimpleTypeDefinition)
         {
            XSSimpleTypeDefinition xsSimpleType = (XSSimpleTypeDefinition)xsType;
            String javaTypeName = null;
           
            // <simpleType name="FooStringListType">
            //   <list itemType="string"/>
            // </simpleType>
            if (xsSimpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST)
            {
               XSSimpleTypeDefinition itemType = xsSimpleType.getItemType();
               QName xmlBaseType = new QName(itemType.getNamespace(), itemType.getName());
               javaTypeName = new LiteralTypeMapping().getJavaTypeName(xmlBaseType);
               if (javaTypeName != null)
               {
                  javaTypeName += "[]";
               }
View Full Code Here

            if (Constants.NS_SCHEMA_XSD.equals(nsuri) && "anyType".equals(tname)) continue;
            xsdJava.createJavaFile(ctype, dirloc, packageName, xsmodel);
         }
         else if (type instanceof XSSimpleTypeDefinition)
         {
            XSSimpleTypeDefinition stype = (XSSimpleTypeDefinition)type;
            //Ignore xsd:anyType
            String nsuri = type.getNamespace();
            String tname = type.getName();
            if (Constants.NS_SCHEMA_XSD.equals(nsuri) && "anyType".equals(tname)) continue;
            xsdJava.createJavaFile(stype, dirloc, packageName, xsmodel);
View Full Code Here

            {
               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

      {
         short der = type.getDerivationMethod();

         if (XSConstants.DERIVATION_EXTENSION == der)
         {
            XSSimpleTypeDefinition xssimple = type.getSimpleType();
            QName q = new QName(xssimple.getNamespace(), xssimple.getName());
            QName qn = schemautils.patchXSDQName(q);
            Class javaType = typeMapping.getJavaType(qn);
            String jtype = null;
            if (javaType.isArray())
            {
View Full Code Here

         int len = xsobjlist.getLength();
         for (int i = 0; i < len; i++)
         {
            XSAttributeUse obj = (XSAttributeUse)xsobjlist.item(i);
            XSAttributeDeclaration att = obj.getAttrDeclaration();
            XSSimpleTypeDefinition xstype = att.getTypeDefinition();
            QName qn = SchemaUtils.handleSimpleType(xstype);
            boolean primitive = obj.getRequired();
            VAR v = createVAR(qn, att.getName(), pkgname, primitive);
            if (vars == null)
               vars = new ArrayList();
View Full Code Here

      if (ctx.trace)
      {
         log.trace("binding attribute " + attrName + " for " + type.getQName() + ", required=" + attrUse.getRequired());
      }

      XSSimpleTypeDefinition attrType = attr.getTypeDefinition();
      TypeBinding typeBinding = bindSimpleType(ctx, attrType);
      AttributeBinding binding = type.addAttribute(attrName, typeBinding, DefaultHandlers.ATTRIBUTE_HANDLER);
      binding.setRequired(attrUse.getRequired());
      if(attrUse.getConstraintType() == XSConstants.VC_DEFAULT)
      {
         // Associate the default value with the binding
         binding.setDefaultConstraint(attrUse.getConstraintValue());
      }

      if (ctx.processAnnotations)
      {
         XSAnnotation an = attr.getAnnotation();
         if(an != null)
         {
            if (ctx.trace)
            {
               log.trace(attrName + " attribute annotation");
            }

            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 (ctx.trace)
      {
         String msg = "bound attribute " + attrName;

         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

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.