Package com.sun.xml.bind.v2.schemagen

Examples of com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace$ElementDeclaration


                                  col,
                                 (Document)r.getNode(),
                                  r.getSystemId());
            }

            JAXBContextImpl riContext;
            if (context instanceof JAXBContextImpl) {
                riContext = (JAXBContextImpl)context;
            } else {
                // fall back if we're using another jaxb implementation
                try {
View Full Code Here


    */

    private static RuntimeTypeInfoSet create(Class... classes) throws Exception {
        IllegalAnnotationsException.Builder errorListener = new IllegalAnnotationsException.Builder();
        RuntimeInlineAnnotationReader reader = new RuntimeInlineAnnotationReader();
        JAXBContextImpl context =
            new JAXBContextImpl(classes, null, Collections.<Class, Class> emptyMap(), null, false, reader, false, false);
        RuntimeModelBuilder builder =
            new RuntimeModelBuilder(context, reader, Collections.<Class, Class> emptyMap(), null);
        builder.setErrorHandler(errorListener);
        for (Class c : classes)
            builder.getTypeInfo(new Ref<Type, Class>(c));
View Full Code Here

        }
        if(jaxbNamespace == null) {
            jaxbNamespace = this.getSchemaTargetNameSpace();
        }

        JAXBContextImpl context = (JAXBContextImpl) createJAXBContext(classes, jaxbNamespace);

        for (DOMResult r : generateJaxbSchemas(context)) {
            Document d = (Document) r.getNode();
            String targetNamespace = d.getDocumentElement().getAttribute("targetNamespace");
            if ("".equals(targetNamespace)) {
                targetNamespace = this.getSchemaTargetNameSpace();
                d.getDocumentElement().setAttribute("targetNamespace", targetNamespace);
            }

            NodeList nodes = d.getDocumentElement().getChildNodes();
            for (int i = 0; i < nodes.getLength(); i++) {
                Node n = nodes.item(i);
                if (n instanceof Element) {
                    Element e = (Element) n;
                    if (e.getLocalName().equals("import")) {
                        d.getDocumentElement().removeChild(e);
                    }
                }
            }

            XmlSchema xmlSchema = xmlSchemaCollection.read(d.getDocumentElement());

            for (Class clazz : classes) {
                JaxBeanInfo<?> beanInfo = context.getBeanInfo(clazz);
                QName qName = getTypeName(beanInfo);
                if(qName != null) {
                    typeTable.addComplexSchema(clazz.getName(), qName);
                }
            }
View Full Code Here

    */

    private static RuntimeTypeInfoSet create(Class... classes) throws Exception {
        IllegalAnnotationsException.Builder errorListener = new IllegalAnnotationsException.Builder();
        RuntimeInlineAnnotationReader reader = new RuntimeInlineAnnotationReader();
        JAXBContextImpl context =
            new JAXBContextImpl(classes, null, Collections.<Class, Class> emptyMap(), null, false, reader, false, false);
        RuntimeModelBuilder builder =
            new RuntimeModelBuilder(context, reader, Collections.<Class, Class> emptyMap(), null);
        builder.setErrorHandler(errorListener);
        for (Class c : classes)
            builder.getTypeInfo(new Ref<Type, Class>(c));
View Full Code Here

/*     */     }
/*     */     catch (IllegalAnnotationsException e) {
/* 814 */       throw new AssertionError(e);
/*     */     }
/*     */
/* 817 */     XmlSchemaGenerator xsdgen = new XmlSchemaGenerator(tis.getNavigator(), tis);
/*     */
/* 823 */     Set rootTagNames = new HashSet();
/* 824 */     for (RuntimeElementInfo ei : tis.getAllElements()) {
/* 825 */       rootTagNames.add(ei.getElementName());
/*     */     }
/* 827 */     for (RuntimeClassInfo ci : tis.beans().values()) {
/* 828 */       if (ci.isElement()) {
/* 829 */         rootTagNames.add(ci.asElement().getElementName());
/*     */       }
/*     */     }
/* 832 */     for (TypeReference tr : this.bridges.keySet()) {
/* 833 */       if (rootTagNames.contains(tr.tagName)) {
/*     */         continue;
/*     */       }
/* 836 */       if ((tr.type == Void.TYPE) || (tr.type == Void.class)) {
/* 837 */         xsdgen.add(tr.tagName, false, null);
/*     */       }
/* 839 */       else if (tr.type != CompositeStructure.class)
/*     */       {
/* 842 */         NonElement typeInfo = getXmlType(tis, tr);
/* 843 */         xsdgen.add(tr.tagName, !Navigator.REFLECTION.isPrimitive(tr.type), typeInfo);
/*     */       }
/*     */     }
/* 846 */     return xsdgen;
/*     */   }
View Full Code Here

        String messageContentModelName = messageReference.getMessageContentModel();
        QName elementQName = null;

        if (WSDL2Constants.NMTOKEN_ELEMENT.equals(messageContentModelName)) {
            ElementDeclaration elementDeclaration = messageReference.getElementDeclaration();
            if (elementDeclaration == null) {
                InterfaceMessageReferenceElement messageReferenceElement =
                        messageReference.toElement();
                QName qName = messageReferenceElement.getElement().getQName();
                throw new AxisFault("Unable to find element " + qName.toString() + " reffered to by operation " + axisOperation.getName().getLocalPart());
            }
            elementQName = elementDeclaration.getName();
        } else if (WSDL2Constants.NMTOKEN_ANY.equals(messageContentModelName)) {
            elementQName = Constants.XSD_ANY;
        } else
        if (WSDL2Constants.NMTOKEN_NONE.equals(messageContentModelName)) {
            // nothing to do here keep the message element as null
View Full Code Here

        }
        ArrayList soapHeaderMessages = new ArrayList();

        for (int i = 0; i < soapHeaderBlocks.length; i++) {
            SOAPHeaderBlock soapHeaderBlock = soapHeaderBlocks[i];
            ElementDeclaration elementDeclaration = soapHeaderBlock.getElementDeclaration();

            if (elementDeclaration != null) {
                QName name = elementDeclaration.getName();
                SOAPHeaderMessage soapHeaderMessage = new SOAPHeaderMessage();
                soapHeaderMessage.setElement(name);
                soapHeaderMessage.setRequired(soapHeaderBlock.isRequired().booleanValue());
                soapHeaderMessage
                        .setMustUnderstand(soapHeaderBlock.mustUnderstand().booleanValue());
View Full Code Here

        Arrays.sort(components, new Comparator() {

            public int compare(Object o1, Object o2) {

                ElementDeclaration ed1 = ((SOAPHeaderBlock) o1)
                        .getElementDeclaration();
                ElementDeclaration ed2 = ((SOAPHeaderBlock) o2)
                        .getElementDeclaration();

                if (ed1 == ed2)
                    return 0;
                if (ed1 == null)
                    return -1;
                if (ed2 == null)
                    return 1;

                QName x1 = ed1.getName();
                QName x2 = ed2.getName();

                return CmBaseWriter.compareQName(x1, x2);
            }
        });
View Full Code Here

        }
        reportWriter.closeReport();
    }

    private void writeVerbose(Description descComp) {
        ElementDeclaration elementDeclarations[] = descComp
                .getElementDeclarations();
        System.out.println("There are " + elementDeclarations.length
                + " ElementDeclaration components.");

        for (int j = 0; j < elementDeclarations.length; j++) {

            ElementDeclaration elementDeclaration = elementDeclarations[j];

            QName name = elementDeclaration.getName();
            System.out
                    .println("ElementDeclaration[" + j + "] : name = " + name);
        }

        TypeDefinition typeDefinitions[] = descComp.getTypeDefinitions();
View Full Code Here

     * @see org.apache.woden.wsdl20.Description#getElementDeclaration(javax.xml.namespace.QName)
     */
    public ElementDeclaration getElementDeclaration(QName qname)
    {
        if(!fComponentsInitialized) initComponents();
        ElementDeclaration elDec = null;
        if(qname != null)
        {
            Iterator i = fAllElementDeclarations.iterator();
            while(i.hasNext())
            {
                ElementDeclaration ed = (ElementDeclaration)i.next();
                if(qname.equals(ed.getName()))
                {
                    elDec = ed;
                    break;
                }
            }
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace$ElementDeclaration

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.