Package org.apache.ws.commons.schema

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


        schemaCol.read(new StreamSource(is));

        XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)schemaCol.getTypeByQName(typeQName);
        assertNotNull(simpleType);

        XmlSchemaAnnotation xsa = simpleType.getAnnotation();
        assertNotNull(xsa);

        List<XmlSchemaAnnotationItem> col = xsa.getItems();
        assertEquals(0, col.size());

    }
View Full Code Here


        schemaCol.read(new StreamSource(is));

        XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)schemaCol.getTypeByQName(typeQName);
        assertNotNull(simpleType);

        XmlSchemaAnnotation xsa = simpleType.getAnnotation();
        assertNotNull(xsa);

        List<XmlSchemaAnnotationItem> col = xsa.getItems();
        assertEquals(2, col.size());

        Set<String> s = new HashSet<String>();
        s.add(XmlSchemaAppInfo.class.getName());
        s.add(XmlSchemaDocumentation.class.getName());
View Full Code Here

        InputStream is = new FileInputStream(Resources.asURI("annotation.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(new StreamSource(is));

        XmlSchemaAnnotation xsa = schema.getAnnotation();
        List<XmlSchemaAnnotationItem> col = xsa.getItems();
        assertEquals(2, col.size());

        Set<String> s = new HashSet<String>();
        s.add(XmlSchemaAppInfo.class.getName());
        s.add(XmlSchemaDocumentation.class.getName());
View Full Code Here

        InputStream is = new FileInputStream(Resources.asURI("annotation-appinfo-no-source.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(new StreamSource(is));
       
        XmlSchemaAnnotation annotation = schema.getAnnotation();
        assertTrue("annotation is retrieved ok", null != annotation);
        List<XmlSchemaAnnotationItem> items = annotation.getItems();
        assertEquals("Annotation contains an appinfo and yet this fails", 1, items.size());

    }
View Full Code Here

        InputStream is = new FileInputStream(Resources.asURI("annotation-appinfo-deep.xsd"));
        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
        XmlSchema schema = schemaCol.read(new StreamSource(is));
       
        XmlSchemaAnnotation annotation = schema.getAnnotation();
        assertTrue("annotation is retrieved ok", null != annotation);
        List<XmlSchemaAnnotationItem> items = annotation.getItems();
        assertTrue(items.get(0) instanceof XmlSchemaAppInfo);
        XmlSchemaAppInfo appInfo = (XmlSchemaAppInfo) items.get(0);
        NodeList markup = appInfo.getMarkup();
        assertTrue("The markup exists", null != markup);
        Node node = markup.item(1);
View Full Code Here

        s.add("teamMascot");
        s.add("teamLogo");
        for (Map.Entry<QName, XmlSchemaNotation> e : notations.entrySet()) {
            XmlSchemaNotation xsn = e.getValue();
            String name = xsn.getName();
            XmlSchemaAnnotation xsa = xsn.getAnnotation();
            List<XmlSchemaAnnotationItem> col = xsa.getItems();
            assertEquals(1, col.size());
            XmlSchemaDocumentation xsd = null;
            for (int k = 0; k < col.size(); k++) {
                xsd = (XmlSchemaDocumentation)col.get(k);
            }
View Full Code Here

                idltype = wsdlToCorbaBinding.getHelper().createQNameCorbaNamespace(qname.getLocalPart()
                                                                                       + "_nil");
            } else {
                if (corbaTypeImpl == null) {
                    XmlSchemaObject schemaObj = getSchemaObject(wsdlToCorbaBinding, typeName);
                    XmlSchemaAnnotation annotation = null;
                    if (schemaObj instanceof XmlSchemaType) {
                        schemaType = (XmlSchemaType)schemaObj;
                    } else if (schemaObj instanceof XmlSchemaElement) {
                        XmlSchemaElement el = (XmlSchemaElement)schemaObj;
                        schemaType = el.getSchemaType();
                        annotation = ((XmlSchemaElement)schemaObj).getAnnotation();
                    }
                    idltype = getSchemaTypeName(wsdlToCorbaBinding, schemaType, annotation, typeName, nill);
                } else {
                    idltype = corbaTypeImpl.getQName();
                }
            }
        } else {
            // We need to get annotation information for the schema type we are
            // about to pass in.
            // This is used to produce the correct object reference type.
            XmlSchemaObject schemaObj = getSchemaObject(wsdlToCorbaBinding, typeName);
            XmlSchemaAnnotation annotation = null;
            if (schemaObj instanceof XmlSchemaElement) {
                annotation = ((XmlSchemaElement)schemaObj).getAnnotation();
            }
            idltype = getSchemaTypeName(wsdlToCorbaBinding, schemaType, annotation, typeName, nill);
        }
View Full Code Here

    private boolean isObjectReference(SchemaCollection schemaList, QName name) {
        for (XmlSchema schema : schemaList.getXmlSchemas()) {
            XmlSchemaElement element = schema.getElementByName(name);
            if (element != null) {
                XmlSchemaAnnotation annotation = element.getAnnotation();
                if (annotation != null) {
                    List<XmlSchemaAnnotationItem> annotationColl = annotation.getItems();
                    for (XmlSchemaAnnotationItem item : annotationColl) {
                        if (item instanceof XmlSchemaAppInfo) {
                            return true;
                        }
                    }
View Full Code Here

            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);

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

            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);
        }
    }
View Full Code Here

TOP

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

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.