Examples of XmlSchemaElement


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

        QName elName = null;
        if (schemaType instanceof XmlSchemaAttribute) {
            readElement = false;
            elName = ((XmlSchemaAttribute) schemaType).getQName();
        } else if (schemaType instanceof XmlSchemaElement) {
            XmlSchemaElement el = (XmlSchemaElement) schemaType;
            elName = ((XmlSchemaElement) el).getQName();
            if (el.isNillable()) {
                readElement = false;
            }
            stype = el.getSchemaType();
            if (stype == null) {
                stype = CorbaUtils.getXmlSchemaType(serviceInfo, el.getRefName());
            }      
        }
        if (stype instanceof XmlSchemaComplexType) {
            XmlSchemaComplexType ctype = (XmlSchemaComplexType) stype;
            stype = ctype.getParticle();
View Full Code Here

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

                        discValue = obj.createDefaultDiscriminatorLabel();
                    }
                    obj.setDiscriminatorValueFromData(discValue);
                    obj.setValue(branchName, branchObj);
                } else {
                    XmlSchemaElement el = (XmlSchemaElement) items.getItem(i);
                    QName qname = new QName("", branch.getName());
                    if (CorbaUtils.isElementFormQualified(serviceInfo, el.getQName().getNamespaceURI())) {
                        qname = el.getQName();
                    }
                    // Create an object holder with no value
                    branchObj = CorbaHandlerUtils.createTypeHandler(orb,
                                                                    qname,
                                                                    branch.getIdltype(),
View Full Code Here

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

        boolean writeElement = true;
        QName elName = null;
        if (schemaType instanceof XmlSchemaAttribute) {
            writeElement = false;
        } else if (schemaType instanceof XmlSchemaElement) {
            XmlSchemaElement el = (XmlSchemaElement) schemaType;
            if (el.isNillable()) {
                //should not write the start Element.
                writeElement = false;
            }
            stype = el.getSchemaType();
            if (stype == null) {
                stype = CorbaUtils.getXmlSchemaType(serviceInfo, el.getRefName());
            }
        }
        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
        if (!writeElement) {
            writeAttributeOrNillableElementToStax(unionHandler, stype, objName, writer, factory);
View Full Code Here

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

                schemaType = arrayVisitor.getSchemaType();
                corbaType = arrayVisitor.getCorbaType();
            }
           
            // xmlschema:member
            XmlSchemaElement member = new XmlSchemaElement();
            String memberName = memberNode.toString();
            member.setName(memberName);
            member.setSchemaType(schemaType);
            member.setSchemaTypeName(schemaType.getQName());

            sequence.getItems().add(member);

           
            // corba:member
View Full Code Here

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

        Scope exceptionScope = new Scope(getScope(), identifierNode);
       
        // xmlschema:exception
        Scope scopedName = new Scope(getScope(), identifierNode);
        String exceptionName = scopedName.toString();
        XmlSchemaElement element = new XmlSchemaElement();
        element.setName(exceptionName);
        element.setQName(new QName(schema.getTargetNamespace(), exceptionName));

        String exceptionTypeName = exceptionName + TYPE_SUFFIX;

        XmlSchemaComplexType complexType = new XmlSchemaComplexType(schema);
        complexType.setName(exceptionTypeName);
        //complexType.setQName(new QName(schema.getTargetNamespace(), exceptionTypeName));
        XmlSchemaSequence sequence = new XmlSchemaSequence();
        complexType.setParticle(sequence);

        element.setSchemaTypeName(complexType.getQName());
       
        // corba:exception
        Exception exception = new Exception();
        exception.setQName(new QName(typeMap.getTargetNamespace(), exceptionName));
        exception.setType(complexType.getQName());
        exception.setRepositoryID(scopedName.toIDLRepositoryID());

       
        // exception members
        AST memberTypeNode = identifierNode.getNextSibling();
        while (memberTypeNode != null) {
            AST memberNode = memberTypeNode.getNextSibling();

            TypesVisitor visitor = new TypesVisitor(exceptionScope,
                                                    schemas,
                                                    schema,
                                                    typeMap,
                                                    null);
            visitor.visit(memberTypeNode);
            XmlSchemaType stype = visitor.getSchemaType();
            CorbaTypeImpl ctype = visitor.getCorbaType();
           
            // needed for anonymous arrays in exceptions
            if (ArrayVisitor.accept(memberNode)) {
                Scope anonScope = new Scope(exceptionScope,
                                            TypesUtils.getCorbaTypeNameNode(memberTypeNode));
                ArrayVisitor arrayVisitor = new ArrayVisitor(anonScope,
                                                             schemas,
                                                             schema,
                                                             typeMap,
                                                             stype,
                                                             ctype,
                                                             null);
                arrayVisitor.visit(memberNode);
                stype = arrayVisitor.getSchemaType();
                ctype = arrayVisitor.getCorbaType();
            }

            // xmlschema:member
            XmlSchemaElement member = new XmlSchemaElement();
            String memberName = memberNode.toString();
            member.setName(memberName);
            member.setSchemaType(stype);
            member.setSchemaTypeName(stype.getQName());

            sequence.getItems().add(member);

           
            // corba:member
View Full Code Here

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

        // we have, then there is no need to add it to the schema again.
        if (!isReferenceSchemaTypeDefined(referenceName)) {
            // We need to add a new element definition to the schema section of our WSDL.
            // For custom endpoint types, this should contain an annotation which points
            // to the binding which will be used for this endpoint type.
            XmlSchemaElement refElement = new XmlSchemaElement();
            refElement.setQName(referenceName);
            refElement.setName(referenceName.getLocalPart());
            refElement.setSchemaType(wsaType);
            refElement.setSchemaTypeName(wsaType.getQName());
     
            // Create an annotation which contains the CORBA binding for the element
            XmlSchemaAnnotation annotation = new XmlSchemaAnnotation();
            XmlSchemaAppInfo appInfo = new XmlSchemaAppInfo();
            try {
                DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document doc = db.newDocument();
                Element el = doc.createElement("appinfo");
                el.setTextContent("corba:binding=" + bindingName.getLocalPart());
                // TODO: This is correct but the appinfo markup is never added to the
                // schema.  Investigate.
                appInfo.setMarkup(el.getChildNodes());
            } catch (ParserConfigurationException ex) {
                throw new RuntimeException("[ObjectReferenceVisitor: error creating endpoint schema]");
            }
           
            annotation.getItems().add(appInfo);
           
            refElement.setAnnotation(annotation);

            schema.getElements().add(referenceName, refElement);
            schema.getItems().add(refElement);
        }
View Full Code Here

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

        for (Iterator iter = schemaObjects.getIterator(); iter.hasNext();) {
            java.lang.Object schemaObj = iter.next();
           
            if (schemaObj instanceof XmlSchemaElement) {
                XmlSchemaElement el = (XmlSchemaElement)schemaObj;
               
                if (el.getName().equals(objectReferenceName.getLocalPart())) {
                    return true;
                }
            }
        }
       
View Full Code Here

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

        XmlSchemaComplexType complexType = new XmlSchemaComplexType(schema);
        complexType.setName(name);

        XmlSchemaSequence sequence = new XmlSchemaSequence();

        XmlSchemaElement element = new XmlSchemaElement();
        element.setMinOccurs(size);
        element.setMaxOccurs(size);
        element.setName("item");
        element.setSchemaTypeName(type);
       
        sequence.getItems().add(element);

        complexType.setParticle(sequence);
View Full Code Here

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

   
    private XmlSchemaElement addElement(XmlSchemaSequence schemaSequence,
                                        XmlSchemaType schemaType,
                                        String name,
                                        boolean isObjectReference) {
        XmlSchemaElement element = new XmlSchemaElement();
        element.setName(name);
        // REVISIT: An object reference requires that we use a ref name.  An element type produces
        // a wsdltojava error.
        if (isObjectReference) {
            element.setRefName(schemaType.getQName());
        } else {
            element.setSchemaTypeName(schemaType.getQName());
        }
        schemaSequence.getItems().add(element);
        return element;
    }
View Full Code Here

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

    private XmlSchemaType generateSchemaType(XmlSchemaType stype, Scope scopedName, long bound) {
        XmlSchemaComplexType ct = new XmlSchemaComplexType(schema);
        ct.setName(scopedName.toString());
        XmlSchemaSequence sequence = new XmlSchemaSequence();
        XmlSchemaElement el = new XmlSchemaElement();
        el.setName("item");
        el.setMinOccurs(0);
        if (bound != -1) {
            el.setMaxOccurs(bound);
        } else {
            el.setMaxOccurs(Long.MAX_VALUE);
        }
        el.setSchemaTypeName(stype.getQName());
        sequence.getItems().add(el);
        ct.setParticle(sequence);
        return ct;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.