Package org.apache.ws.commons.schema

Examples of org.apache.ws.commons.schema.XmlSchemaAny


        /**
         * if future proof then add <xsd:any/> element
         */
        if (inf.isExtensibleElements()) {
            XmlSchemaAny any = new XmlSchemaAny();
            any.setMinOccurs(0);
            any.setMaxOccurs(Long.MAX_VALUE);
            sequence.getItems().add(any);
        }

        // Write out schema for attributes
        for (QName name : inf.getAttributes()) {
View Full Code Here


    }

    private void deserializeAny(XmlSchemaComplexType type,
                                ParticleInfo itemInfo,
                                ParticleInfo nextItem) {
        XmlSchemaAny any = (XmlSchemaAny)itemInfo.getParticle();
       
        boolean array = XmlSchemaUtils.isParticleArray(any);
        boolean optional = XmlSchemaUtils.isParticleOptional(any);
       
        if (array) {
            utils.appendLine("var anyObject = [];");
        } else {
            utils.appendLine("var anyObject = null;");

        }

        String anyNamespaceSpec = any.getNamespace();
        // we aren't dealing with any-after-any.
        XmlSchemaElement nextElement = null;
        if (nextItem != null) {
            nextElement = (XmlSchemaElement)nextItem.getParticle();
        }
        String matchType;
        String namespaceList = "[]";
       
        if (anyNamespaceSpec == null
            || "##any".equals(anyNamespaceSpec)
            || "".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.ANY";
        } else if ("##other".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.OTHER";
        } else if ("##local".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.LOCAL";
        } else {
            matchType = "org_apache_cxf_any_ns_matcher.LISTED";
            namespaceList = buildNamespaceList(anyNamespaceSpec);
        }
       
        String nextLocalPartConstant = "null";
        if (nextElement != null) {
            nextLocalPartConstant = "'" + nextElement.getQName().getLocalPart() + "'";
        }
       
        utils.appendLine("var matcher = new org_apache_cxf_any_ns_matcher("
                         + matchType
                         + ", '" + schemaInfo.getNamespaceURI() + "'"
                         + ", " + namespaceList
                         + ", " + nextLocalPartConstant
                         + ");");
       
        if (array) {
            utils.appendLine("var anyNeeded = " + any.getMinOccurs() + ";");
            utils.appendLine("var anyAllowed = " + any.getMaxOccurs() + ";");
        } else if (optional) {
            utils.appendLine("var anyNeeded = 0;");
            utils.appendLine("var anyAllowed = 1;");
        } else {
            utils.appendLine("var anyNeeded = 1;");
View Full Code Here

    }

    private void deserializeAny(XmlSchemaComplexType type,
                                ParticleInfo itemInfo,
                                ParticleInfo nextItem) {
        XmlSchemaAny any = (XmlSchemaAny)itemInfo.getParticle();
       
        boolean array = XmlSchemaUtils.isParticleArray(any);
        boolean optional = XmlSchemaUtils.isParticleOptional(any);
       
        if (array) {
            utils.appendLine("var anyObject = [];");
        } else {
            utils.appendLine("var anyObject = null;");

        }

        String anyNamespaceSpec = any.getNamespace();
        // we aren't dealing with any-after-any.
        XmlSchemaElement nextElement = null;
        if (nextItem != null) {
            nextElement = (XmlSchemaElement)nextItem.getParticle();
        }
        String matchType;
        String namespaceList = "[]";
       
        if (anyNamespaceSpec == null
            || "##any".equals(anyNamespaceSpec)
            || "".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.ANY";
        } else if ("##other".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.OTHER";
        } else if ("##local".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.LOCAL";
        } else {
            matchType = "org_apache_cxf_any_ns_matcher.LISTED";
            namespaceList = buildNamespaceList(anyNamespaceSpec);
        }
       
        String nextLocalPartConstant = "null";
        if (nextElement != null) {
            nextLocalPartConstant = "'" + nextElement.getQName().getLocalPart() + "'";
        }
       
        utils.appendLine("var matcher = new org_apache_cxf_any_ns_matcher("
                         + matchType
                         + ", '" + xmlSchema.getTargetNamespace() + "'"
                         + ", " + namespaceList
                         + ", " + nextLocalPartConstant
                         + ");");
       
        if (array) {
            utils.appendLine("var anyNeeded = " + any.getMinOccurs() + ";");
            utils.appendLine("var anyAllowed = " + any.getMaxOccurs() + ";");
        } else if (optional) {
            utils.appendLine("var anyNeeded = 0;");
            utils.appendLine("var anyAllowed = 1;");
        } else {
            utils.appendLine("var anyNeeded = 1;");
View Full Code Here

        /**
         * if future proof then add <xsd:any/> element
         */
        if (inf.isExtensibleElements()) {
            XmlSchemaAny any = new XmlSchemaAny();
            any.setMinOccurs(0);
            any.setMaxOccurs(Long.MAX_VALUE);
            sequence.getItems().add(any);
        }

        // Write out schema for attributes
        for (QName name : inf.getAttributes()) {
View Full Code Here

        /**
         * if future proof then add <xsd:any/> element
         */
        if (inf.isExtensibleElements()) {
            XmlSchemaAny any = new XmlSchemaAny();
            any.setMinOccurs(0);
            any.setMaxOccurs(Long.MAX_VALUE);
            sequence.getItems().add(any);
        }

        // Write out schema for attributes
        for (QName name : inf.getAttributes()) {
View Full Code Here

    }

    private void deserializeAny(XmlSchemaComplexType type,
                                ParticleInfo itemInfo,
                                ParticleInfo nextItem) {
        XmlSchemaAny any = (XmlSchemaAny)itemInfo.getParticle();
       
        boolean array = XmlSchemaUtils.isParticleArray(any);
        boolean optional = XmlSchemaUtils.isParticleOptional(any);
       
        if (array) {
            utils.appendLine("var anyObject = [];");
        } else {
            utils.appendLine("var anyObject = null;");

        }

        String anyNamespaceSpec = any.getNamespace();
        // we aren't dealing with any-after-any.
        XmlSchemaElement nextElement = null;
        if (nextItem != null) {
            nextElement = (XmlSchemaElement)nextItem.getParticle();
        }
        String matchType;
        String namespaceList = "[]";
       
        if (anyNamespaceSpec == null
            || "##any".equals(anyNamespaceSpec)
            || "".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.ANY";
        } else if ("##other".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.OTHER";
        } else if ("##local".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.LOCAL";
        } else {
            matchType = "org_apache_cxf_any_ns_matcher.LISTED";
            namespaceList = buildNamespaceList(anyNamespaceSpec);
        }
       
        String nextLocalPartConstant = "null";
        if (nextElement != null) {
            nextLocalPartConstant = "'" + nextElement.getQName().getLocalPart() + "'";
        }
       
        utils.appendLine("var matcher = new org_apache_cxf_any_ns_matcher("
                         + matchType
                         + ", '" + xmlSchema.getTargetNamespace() + "'"
                         + ", " + namespaceList
                         + ", " + nextLocalPartConstant
                         + ");");
       
        if (array) {
            utils.appendLine("var anyNeeded = " + any.getMinOccurs() + ";");
            utils.appendLine("var anyAllowed = " + any.getMaxOccurs() + ";");
        } else if (optional) {
            utils.appendLine("var anyNeeded = 0;");
            utils.appendLine("var anyAllowed = 1;");
        } else {
            utils.appendLine("var anyNeeded = 1;");
View Full Code Here

                } else if (item instanceof XmlSchemaAny) {

                    // if this is an instance of xs:any, then there is no part name for it. Using ANY_ELEMENT_FIELD_NAME
                    // for it for now

                    XmlSchemaAny xmlSchemaAny = (XmlSchemaAny) item;
                    boolean isArray = xmlSchemaAny.getMaxOccurs() > 1;

                    QName partQName = WSDLUtil.getPartQName(opName,
                            qnameSuffix,
                            Constants.ANY_ELEMENT_FIELD_NAME);
View Full Code Here

                    metainfHolder.addtStatus(elt.getQName(),
                                             SchemaConstants.BINARY_TYPE);
                }
                // process the XMLSchemaAny
            } else if (child instanceof XmlSchemaAny) {
                XmlSchemaAny any = (XmlSchemaAny) child;

                //since there is only one element here it does not matter
                //for the constant. However the problem occurs if the users
                //uses the same name for an element decalration
                QName anyElementFieldName = new QName(ANY_ELEMENT_FIELD_NAME);

                //this can be an array or a single element
                boolean isArray = processedElementArrayStatusMap.get(any);
                metainfHolder.registerMapping(anyElementFieldName,
                                              null,
                                              isArray ? writer.getDefaultClassArrayName() : writer.
                                                      getDefaultClassName(),
                                              SchemaConstants.ANY_TYPE);
                //if it's an array register an extra status flag with the system
                if (isArray) {
                    metainfHolder.addtStatus(anyElementFieldName,
                                             SchemaConstants.ARRAY_TYPE);
                }
                metainfHolder.addMaxOccurs(anyElementFieldName, any.getMaxOccurs());
                metainfHolder.addMinOccurs(anyElementFieldName, any.getMinOccurs());

                if (order) {
                    //record the order in the metainf holder for the any
                    metainfHolder.registerQNameIndex(anyElementFieldName,
                                                     startingItemNumberOrder +
View Full Code Here

                elementOrderMap.put(xsElt, sequenceCounter);
            }

            //handle xsd:any ! We place an OMElement (or an array of OMElements) in the generated class
        } else if (item instanceof XmlSchemaAny) {
            XmlSchemaAny any = (XmlSchemaAny) item;
            processedElementTypeMap.put(new QName(ANY_ELEMENT_FIELD_NAME), any);
            //any can also be inside a sequence
            if (order) {
                elementOrderMap.put(any, new Integer(sequenceCounter));
            }
View Full Code Here

    }

    private void deserializeAny(XmlSchemaComplexType type,
                                ParticleInfo itemInfo,
                                ParticleInfo nextItem) {
        XmlSchemaAny any = (XmlSchemaAny)itemInfo.getParticle();
       
        boolean array = XmlSchemaUtils.isParticleArray(any);
        boolean optional = XmlSchemaUtils.isParticleOptional(any);
       
        if (array) {
            utils.appendLine("var anyObject = [];");
        } else {
            utils.appendLine("var anyObject = null;");

        }

        String anyNamespaceSpec = any.getNamespace();
        // we aren't dealing with any-after-any.
        XmlSchemaElement nextElement = null;
        if (nextItem != null) {
            nextElement = (XmlSchemaElement)nextItem.getParticle();
        }
        String matchType;
        String namespaceList = "[]";
       
        if (anyNamespaceSpec == null
            || "##any".equals(anyNamespaceSpec)
            || "".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.ANY";
        } else if ("##other".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.OTHER";
        } else if ("##local".equals(anyNamespaceSpec)) {
            matchType = "org_apache_cxf_any_ns_matcher.LOCAL";
        } else {
            matchType = "org_apache_cxf_any_ns_matcher.LISTED";
            namespaceList = buildNamespaceList(anyNamespaceSpec);
        }
       
        String nextLocalPartConstant = "null";
        if (nextElement != null) {
            nextLocalPartConstant = "'" + nextElement.getQName().getLocalPart() + "'";
        }
       
        utils.appendLine("var matcher = new org_apache_cxf_any_ns_matcher("
                         + matchType
                         + ", '" + xmlSchema.getTargetNamespace() + "'"
                         + ", " + namespaceList
                         + ", " + nextLocalPartConstant
                         + ");");
       
        if (array) {
            utils.appendLine("var anyNeeded = " + any.getMinOccurs() + ";");
            utils.appendLine("var anyAllowed = " + any.getMaxOccurs() + ";");
        } else if (optional) {
            utils.appendLine("var anyNeeded = 0;");
            utils.appendLine("var anyAllowed = 1;");
        } else {
            utils.appendLine("var anyNeeded = 1;");
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.schema.XmlSchemaAny

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.