Package com.laamella.snelxml.crap

Examples of com.laamella.snelxml.crap.QName


            final String prefix = prefixer.getPrefixForNamespace(element.name.namespace);
            writer.writeStartElement(prefix, element.name.localPart, element.name.namespace);
        }
        if (element.isComplex()) {
            for (final Node attribute : element.attributes) {
                final QName name = attribute.name;
                if (name.namespace.equals("")) {
                    writer.writeAttribute(name.localPart, generateSampleFor(attribute.type));
                } else {
                    final String prefix = prefixer.getPrefixForNamespace(name.namespace);
                    writer.writeAttribute(prefix, name.namespace, name.localPart, generateSampleFor(attribute.type));
View Full Code Here


        log.trace("Parsing {}", xsElement);
        final XSTypeDefinition typeDefinition = xsElement.getTypeDefinition();
        switch (typeDefinition.getTypeCategory()) {
            case SIMPLE_TYPE: {
                final XSSimpleTypeDefinition simpleTypeDefinition = (XSSimpleTypeDefinition) typeDefinition;
                return new Node(parent, new QName(xsElement.getNamespace(), xsElement.getName()), convert(simpleTypeDefinition));
            }
            case COMPLEX_TYPE: {
                final XSComplexTypeDefinition complexTypeDefinition = (XSComplexTypeDefinition) typeDefinition;
                final Node element = new Node(parent, new QName(xsElement.getNamespace(), xsElement.getName()), new HashSet<Node>(), new ArrayList<Node>());

                final XSObjectList attributeUses = complexTypeDefinition.getAttributeUses();
                for (final Object attributeObject : attributeUses) {
                    final XSAttributeUse attributeUse = (XSAttributeUse) attributeObject;
                    final XSAttributeDeclaration attributeDeclaration = attributeUse.getAttrDeclaration();

                    log.trace("Attribute {{}}{}", attributeDeclaration.getNamespace(), attributeDeclaration.getName());
                    final Node attribute = new Node(element, new QName(attributeDeclaration.getNamespace(), attributeDeclaration.getName()), convert(attributeDeclaration.getTypeDefinition()));
                    element.attributes.add(attribute);
                }

                final XSParticle particle = complexTypeDefinition.getParticle();
                if (particle != null) {
View Full Code Here

TOP

Related Classes of com.laamella.snelxml.crap.QName

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.