Package javax.xml.stream.events

Examples of javax.xml.stream.events.Attribute


        }
    }
    private static void writeAttributeEvent(XMLEvent event, XMLStreamWriter writer)
        throws XMLStreamException {
       
        Attribute attr = (Attribute)event;
        QName name = attr.getName();
        String nsURI = name.getNamespaceURI();
        String localName = name.getLocalPart();
        String prefix = name.getPrefix();
        String value = attr.getValue();

        if (prefix != null) {
            writer.writeAttribute(prefix, nsURI, localName, value);
        } else if (nsURI != null) {
            writer.writeAttribute(nsURI, localName, value);
View Full Code Here


        }
    }
    private static void writeAttributeEvent(XMLEvent event, XMLStreamWriter writer)
        throws XMLStreamException {
       
        Attribute attr = (Attribute)event;
        QName name = attr.getName();
        String nsURI = name.getNamespaceURI();
        String localName = name.getLocalPart();
        String prefix = name.getPrefix();
        String value = attr.getValue();

        if (prefix != null) {
            writer.writeAttribute(prefix, nsURI, localName, value);
        } else if (nsURI != null) {
            writer.writeAttribute(nsURI, localName, value);
View Full Code Here

        if (iter == null)
            return;

        while (iter.hasNext())
        {
            Attribute attr = (Attribute) iter.next();
            if (ctx.isSameAttributeName(attr.getName(), VERSION))
                this.setVersion(attr.getValue());
            else if (ctx.isSameAttributeName(attr.getName(), UPDATE_SEQUENCE))
                this.setUpdateSequence(attr.getValue());
        }
    }
View Full Code Here

        }
    }
    private static void writeAttributeEvent(XMLEvent event, XMLStreamWriter writer)
        throws XMLStreamException {
       
        Attribute attr = (Attribute)event;
        QName name = attr.getName();
        String nsURI = name.getNamespaceURI();
        String localName = name.getLocalPart();
        String prefix = name.getPrefix();
        String value = attr.getValue();

        if (prefix != null) {
            writer.writeAttribute(prefix, nsURI, localName, value);
        } else if (nsURI != null) {
            writer.writeAttribute(nsURI, localName, value);
View Full Code Here

               Map<String, String> attr = new HashMap<String, String>();

               Iterator attributes = startElement.getAttributes();
               while (attributes.hasNext())
               {
                  Attribute attribute = (Attribute)attributes.next();
                  attr.put(attribute.getName().getLocalPart(), attribute.getValue());
               }

               String localName = startElement.getName().getLocalPart();
               if (localName.equals(REFERENCE_ELEMENT))
               {
View Full Code Here

            XMLEvent rootElement = xmlReader.nextTag();

            if (rootElement instanceof StartElement) {
                StartElement startElement = (StartElement)rootElement;
                Attribute toAttribute = startElement.getAttributeByName(ATTRIBUTE_TO);
                if (toAttribute != null) {
                    to = toAttribute.getValue();
                }
            }
            while (true) {
                if (isStopped()) {
                    break;
View Full Code Here

        }
    }
    private static void writeAttributeEvent(XMLEvent event, XMLStreamWriter writer)
        throws XMLStreamException {
       
        Attribute attr = (Attribute)event;
        QName name = attr.getName();
        String nsURI = name.getNamespaceURI();
        String localName = name.getLocalPart();
        String prefix = name.getPrefix();
        String value = attr.getValue();

        if (prefix != null) {
            writer.writeAttribute(prefix, nsURI, localName, value);
        } else if (nsURI != null) {
            writer.writeAttribute(nsURI, localName, value);
View Full Code Here

                }
               
                StartElement el = e.asStartElement();
               
                if (el.getName().getLocalPart().equals("depends")) {
                    Attribute pluginAttr = el.getAttributeByName(new QName("plugin"));
                    if (pluginAttr == null) {
                        throw new IllegalArgumentException("Couldn't find the 'plugin' attribute on a 'depends' element in the plugin descriptor of plugin '" + archive + "'.");
                    }
                   
                    String pluginName = pluginAttr.getValue();
                    boolean required = true;
                    boolean useClasses = false;
                   
                    Attribute requiredAttr = el.getAttributeByName(new QName("required"));
                    if (requiredAttr != null) {
                        required = Boolean.parseBoolean(requiredAttr.getValue());
                    }
                   
                    Attribute useClassesAttr = el.getAttributeByName(new QName("useClasses"));
                    if (useClassesAttr != null) {
                        useClasses = Boolean.parseBoolean(useClassesAttr.getValue());
                    }
                   
                    ret.add(new PluginDep(pluginName, useClasses, required));
                }
            }
View Full Code Here

            String tagName = startElement.getName().getLocalPart();
            if (!"plugin".equals(tagName)) {
                throw new IllegalArgumentException("Illegal start tag found in the plugin descriptor. Expected 'plugin' but found '" + tagName + "' in the plugin '" + archive + "'.");
            }
           
            Attribute nameAttr = startElement.getAttributeByName(new QName("name"));
           
            if (nameAttr == null) {
                throw new IllegalArgumentException("Couldn't find the name attribute on the plugin tag in the plugin descriptor of plugin '" + archive + "'.");
            }
           
            return nameAttr.getValue();
        } catch (XMLStreamException e) {
            throw new IllegalArgumentException("Failed to extract the plugin name out of the RHQ plugin archive [" + archive + "]", e);
        } catch (FactoryConfigurationError e) {
            throw new IllegalArgumentException("Failed to extract the plugin name out of the RHQ plugin archive [" + archive + "]", e);
        } finally {
View Full Code Here

            String tagName = startElement.getName().getLocalPart();
            if (!"plugin".equals(tagName)) {
                throw new IllegalArgumentException("Illegal start tag found in the plugin descriptor. Expected 'plugin' but found '" + tagName + "' in the plugin '" + archive + "'.");
            }

            Attribute nameAttr = startElement.getAttributeByName(new QName("name"));

            if (nameAttr == null) {
                throw new IllegalArgumentException("Couldn't find the name attribute on the plugin tag in the plugin descriptor of plugin '" + archive + "'.");
            }

            return nameAttr.getValue();
        } catch (XMLStreamException e) {
            throw new IllegalArgumentException("Failed to extract the plugin name out of the RHQ plugin archive [" + archive + "]", e);
        } catch (FactoryConfigurationError e) {
            throw new IllegalArgumentException("Failed to extract the plugin name out of the RHQ plugin archive [" + archive + "]", e);
        } finally {
View Full Code Here

TOP

Related Classes of javax.xml.stream.events.Attribute

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.