Package org.apache.ws.commons.schema

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


    }

    private void complexTypeSerializeAttributes(XmlSchemaComplexType type, String string) {
        XmlSchemaObjectCollection attributes = type.getAttributes();
        for (int ax = 0; ax < attributes.getCount(); ax++) {
            @SuppressWarnings("unused") // work in progress.
            XmlSchemaAttribute attribute = (XmlSchemaAttribute)attributes.getItem(ax);
        }
    }
View Full Code Here


            sequence.getItems().add(any);
        }

        // Write out schema for attributes
        for (QName name : inf.getAttributes()) {
            XmlSchemaAttribute attribute = new XmlSchemaAttribute();
            complex.getAttributes().add(attribute);
            attribute.setName(name.getLocalPart());
            Type type = getType(inf, name);
            attribute.setSchemaTypeName(type.getSchemaType());
            String ns = name.getNamespaceURI();
            if (!ns.equals(root.getTargetNamespace())) {
                XmlSchemaUtils.addImportIfNeeded(root, ns);
            }
        }
View Full Code Here

    public XmlSchemaAttribute getAttributeByQName(QName qname) {
        String uri = qname.getNamespaceURI();
        for (XmlSchema schema : schemaCollection.getXmlSchemas()) {
            if (uri.equals(schema.getTargetNamespace())) {
                XmlSchemaObjectTable attributes = schema.getAttributes();
                XmlSchemaAttribute attribute = (XmlSchemaAttribute)attributes.getItem(qname);
                if (attribute != null) {
                    return attribute;
                }
            }
        }
View Full Code Here

        for (int x = 0; x < schema.getItems().getCount(); x++) {
            XmlSchemaObject item = schema.getItems().getItem(x);
            if (item instanceof XmlSchemaElement) {
                addElementCrossImportsElement(schema, item);
            } else if (item instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute attr = (XmlSchemaAttribute)item;
                XmlSchemaUtils.addImportIfNeeded(schema, attr.getRefName());
                XmlSchemaUtils.addImportIfNeeded(schema, attr.getSchemaTypeName());
                if (attr.getSchemaType() != null) {
                    XmlSchemaUtils.addImportIfNeeded(schema, attr.getSchemaType().getBaseSchemaTypeName());
                }
            } else if (item instanceof XmlSchemaType) {
                XmlSchemaType type = (XmlSchemaType)item;
                addCrossImportsType(schema, type);
            }
View Full Code Here

        }
    }

    private void addCrossImportsAttributeList(XmlSchema schema, XmlSchemaObjectCollection attributes) {
        for (int x = 0; x < attributes.getCount(); x++) {
            XmlSchemaAttribute attr = (XmlSchemaAttribute)attributes.getItem(x);
            XmlSchemaUtils.addImportIfNeeded(schema, attr.getRefName());
        }
    }
View Full Code Here

        boolean howdy = false;
        boolean bleh = false;
        for (int x = 0; x < stype.getAttributes().getCount(); x++) {
            XmlSchemaObject o = stype.getAttributes().getItem(x);
            if (o instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
                if ("howdy".equals(a.getName())) {
                    howdy = true;
                }
                if ("bleh".equals(a.getName())) {
                    bleh = true;
                }
            }
        }
        assertTrue(howdy);
View Full Code Here

        }

        for (int x = 0; x < stype.getAttributes().getCount(); x++) {
            XmlSchemaObject o = stype.getAttributes().getItem(x);
            if (o instanceof XmlSchemaAttribute) {
                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
                if ("howdy".equals(a.getName())) {
                    howdy = true;
                }
            }
        }
View Full Code Here

    }

    private void complexTypeSerializeAttributes(XmlSchemaComplexType type, String string) {
        XmlSchemaObjectCollection attributes = type.getAttributes();
        for (int ax = 0; ax < attributes.getCount(); ax++) {
            @SuppressWarnings("unused") // work in progress.
            XmlSchemaAttribute attribute = (XmlSchemaAttribute)attributes.getItem(ax);
        }
    }
View Full Code Here

        XmlSchemaAnnotated annotated = XmlSchemaUtils.getObjectAnnotated(sequenceObject, contextName);
        AttributeInfo attributeInfo = new AttributeInfo();
        XmlSchemaAnnotated realAnnotated = annotated;

        if (annotated instanceof XmlSchemaAttribute) {
            XmlSchemaAttribute attribute = (XmlSchemaAttribute)annotated;
            attributeInfo.use = attribute.getUse();

            if (attribute.getRef().getTarget() != null) {
                realAnnotated = attribute.getRef().getTarget();
                attributeInfo.global = true;
            }
        } else if (annotated instanceof XmlSchemaAnyAttribute) {
            attributeInfo.any = true;
            attributeInfo.xmlName = null; // unknown until runtime.
View Full Code Here

                                      SchemaCollection schemaCollection,
                                      NamespacePrefixAccumulator prefixAccumulator,
                                      AttributeInfo attributeInfo) {

        if (annotated instanceof XmlSchemaAttribute) {
            XmlSchemaAttribute attribute = (XmlSchemaAttribute)annotated;
            String attributeNamespaceURI = attribute.getQName().getNamespaceURI();
            boolean attributeNoNamespace = "".equals(attributeNamespaceURI);

            XmlSchema attributeSchema = null;
            if (!attributeNoNamespace) {
                attributeSchema = schemaCollection.getSchemaByTargetNamespace(attributeNamespaceURI);
                if (attributeSchema == null) {
                    throw new RuntimeException("Missing schema " + attributeNamespaceURI);
                }
            }

            boolean qualified = !attributeNoNamespace
                                && XmlSchemaUtils.isAttributeQualified(attribute, true, currentSchema,
                                                                     attributeSchema);
            attributeInfo.xmlName = prefixAccumulator.xmlAttributeString(attribute, qualified);
            // we are assuming here that we are not dealing, in close proximity,
            // with elements with identical local names and different
            // namespaces.
            attributeInfo.javascriptName = attribute.getQName().getLocalPart();
            attributeInfo.defaultValue = attribute.getDefaultValue();
            attributeInfo.fixedValue = attribute.getFixedValue();
            attributeInfo.use = attribute.getUse();
            factorySetupType(attribute, schemaCollection, attributeInfo);
        } else { // any
            attributeInfo.any = true;
            attributeInfo.xmlName = null; // unknown until runtime.
            attributeInfo.javascriptName = "any";
View Full Code Here

TOP

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

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.