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

Examples of com.sun.xml.bind.v2.schemagen.xmlschema.Particle


        HashMap<String, Schema> xsds = initWrappersSchemaWithImports(wrappers);
        postInit(xsds);
        for(WrapperParameter wp : wrappers) {
            String tns = wp.getName().getNamespaceURI();
            Schema xsd = xsds.get(tns);           
            Element e =  xsd._element(Element.class);
            e._attribute("name", wp.getName().getLocalPart());
            e.type(wp.getName());
            ComplexType ct =  xsd._element(ComplexType.class);
            ct._attribute("name", wp.getName().getLocalPart());
            ExplicitGroup sq = ct.sequence();           
            for (ParameterImpl p : wp.getWrapperChildren() ) if (p.getBinding().isBody()) addChild(sq, p);
        }
View Full Code Here


            Element e =  xsd._element(Element.class);
            e._attribute("name", wp.getName().getLocalPart());
            e.type(wp.getName());
            ComplexType ct =  xsd._element(ComplexType.class);
            ct._attribute("name", wp.getName().getLocalPart());
            ExplicitGroup sq = ct.sequence();           
            for (ParameterImpl p : wp.getWrapperChildren() ) if (p.getBinding().isBody()) addChild(sq, p);
        }
        for(Schema xsd: xsds.values()) xsd.commit();
    }
View Full Code Here

            child.maxOccurs("unbounded");
        }
    }
   
    protected Occurs addChild(ExplicitGroup sq, QName name, TypeInfo typeInfo) {
        LocalElement le = null;;
        QName type = model.getBindingContext().getTypeName(typeInfo);
        if (type != null) {
            le = sq.element();
            le._attribute("name", name.getLocalPart());
            le.type(type);
        } else {
            if (typeInfo.type instanceof Class) {
                try {
                    QName elemName = model.getBindingContext().getElementName((Class)typeInfo.type);
                    if (elemName.getLocalPart().equals("any") && elemName.getNamespaceURI().equals(XsdNs)) {
                        return sq.any();
                    } else {
                        le = sq.element();
                        le.ref(elemName);
                    }
                } catch (JAXBException je) {
                    throw new WebServiceException(je.getMessage(), je);
                }
            }
View Full Code Here

            typeInfo = param.getTypeInfo();
        } else {
            if (typeInfo.getWrapperType() != null) typeInfo = param.getTypeInfo();
            else repeatedElement = true;
        }
        Occurs child = addChild(sq, param.getName(), typeInfo);
        if (repeatedElement && child != null) {
            child.maxOccurs("unbounded");
        }
    }
View Full Code Here

            }
        }

        @Override
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            Particle c = kind.write(parent);
            writeOccurs(c,isOptional,repeated);

            for (Tree child : children) {
                child.write(c,false,false);
            }
View Full Code Here

/* 241 */       return true;
/*     */     }
/*     */
/*     */     protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated)
/*     */     {
/* 247 */       Particle c = this.kind.write(parent);
/* 248 */       writeOccurs(c, isOptional, repeated);
/*     */
/* 250 */       for (Tree child : this.children)
/* 251 */         child.write(c, false, false);
/*     */     }
View Full Code Here

            }
        }

        @Override
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            Particle c = kind.write(parent);
            writeOccurs(c,isOptional,repeated);

            for (Tree child : children) {
                child.write(c,false,false);
            }
View Full Code Here

    public void writeBinary(DataHandler dh) throws XMLStreamException {
        int len =0;
        byte[] data = null;
        InputStream is = null;
        ByteArrayOutputStreamEx baos = null;
        try {
            baos = new ByteArrayOutputStreamEx();
            is = dh.getDataSource().getInputStream();
            baos.readFrom(is);
            data = baos.toByteArray();
            len = data.length;
            baos.close();
            is.close();
        } catch (IOException ioe) {
            logger.log(Level.SEVERE, "could not get the inputstream from the data handler", ioe);
        }
        if (len > 1000) {
View Full Code Here

            }
        }

        @Override
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            Particle c = kind.write(parent);
            writeOccurs(c,isOptional,repeated);

            for (Tree child : children) {
                child.write(c,false,false);
            }
View Full Code Here

            }
        }

        @Override
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            Particle c = kind.write(parent);
            writeOccurs(c,isOptional,repeated);

            for (Tree child : children) {
                child.write(c,false,false);
            }
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.schemagen.xmlschema.Particle

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.