Examples of asEndElement()


Examples of javax.xml.stream.events.XMLEvent.asEndElement()

        if (event.isStartElement()) {
          StartElement start = event.asStartElement();
          if (isRemovable(start)) {
            while (reader.hasNext()) {
              XMLEvent next = reader.nextEvent();
              if (next.isEndElement() && next.asEndElement().getName().equals(start.getName()))
                continue EventLoop;
            }
            // If this is reached, we finished the document before the tag ended
            throw new RuntimeException(String.format("End of file was reached before %s closing tag was found.",
                    start.getName()));
View Full Code Here

Examples of javax.xml.stream.events.XMLEvent.asEndElement()

          }

        }

        if (event.isEndElement()) {
          EndElement end = event.asEndElement();

          String tag = end.getName().getLocalPart();

          if (tag.equalsIgnoreCase("reports") && report != null) {
            rule.getReportPool().put(report.getId(), report);
View Full Code Here

Examples of javax.xml.stream.events.XMLEvent.asEndElement()

            event = eventReader.nextEvent();
            copyright = event.asCharacters().getData();
            continue;
          }
        } else if (event.isEndElement()) {
          if (event.asEndElement().getName().getLocalPart() == (ITEM)) {
            FeedMessage message = new FeedMessage();
            message.setAuthor(author);
            /**
             * bugfix: if description was not explicitly set to the
             * empty string, it would still contain the last
View Full Code Here

Examples of javax.xml.stream.events.XMLEvent.asEndElement()

                  stack.push(refEntity);
               }

               break;
            case XMLStreamConstants.END_ELEMENT :
               EndElement endElement = event.asEndElement();
               localName = endElement.getName().getLocalPart();

               if (localName.equals(REFERENCE_ELEMENT))
               {
                  RefEntity refEntity = stack.pop();
View Full Code Here

Examples of javax.xml.stream.events.XMLEvent.asEndElement()

                        message.append("Different elements ").append(startA.getName()).append(", ").append(startB.getName()).append(" at location ").append(eventA.getLocation());
                        return false;
                    }
                } else if (eventType == XMLStreamConstants.END_ELEMENT) {
                    EndElement endA = eventA.asEndElement();
                    EndElement endB = eventB.asEndElement();
                    if (!endA.getName().getLocalPart().equals(endB.getName().getLocalPart())) {
                        message.append("Different elements ").append(endA.getName()).append(", ").append(endB.getName()).append(" at location ").append(eventA.getLocation());
                        return false;
                    }
                } else if (eventType == XMLStreamConstants.CHARACTERS) {
View Full Code Here

Examples of javax.xml.stream.events.XMLEvent.asEndElement()

                }
                if (event.isEndElement()) {

                    StartElement top = stack.remove(stack.size()-1);
                    assertEquals(top.getName(),event.asEndElement().getName());
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            fail();
View Full Code Here

Examples of javax.xml.stream.events.XMLEvent.asEndElement()

        while (xmlReader.hasNext()) {
            XMLEvent e = xmlReader.nextEvent();
            if (e.isStartDocument()) handler.startDocument();
            else if (e.isEndDocument()) handler.endDocument();
            else if (e.isStartElement()) emitSE(e.asStartElement());
            else if (e.isEndElement()) emitEE(e.asEndElement());
            else if (e.isProcessingInstruction()) emitPi((ProcessingInstruction) e);
            else if (e.isCharacters()) emitChars(e.asCharacters());
            else if (e.isAttribute()) emitAttr((Attribute) e);
            else if (e.isEntityReference()) emitEnt((EntityDeclaration) e);
            else if (e.isNamespace()) emitNS((Namespace) e);
View Full Code Here

Examples of javax.xml.stream.events.XMLEvent.asEndElement()

                    addNamespaceDeclarations();
                    fNamespaceContext.pushContext();
                    fSchemaDOMParser.startElement(fElementQName, fAttributes, null);
                    break;
                case XMLStreamConstants.END_ELEMENT:
                    EndElement end = currentEvent.asEndElement();
                    fillQName(fElementQName, end.getName());
                    fillDeclaredPrefixes(end);
                    fLocationWrapper.setLocation(end.getLocation());
                    fSchemaDOMParser.endElement(fElementQName, null);
                    fNamespaceContext.popContext();
View Full Code Here

Examples of javax.xml.stream.events.XMLEvent.asEndElement()

                    case XMLStreamConstants.START_ELEMENT :
                        depth++;
                        handleStartElement(event.asStartElement());
                        break;
                    case XMLStreamConstants.END_ELEMENT :
                        handleEndElement(event.asEndElement());
                        depth--;
                        break;
                    case XMLStreamConstants.CHARACTERS :
                        handleCharacters(event.asCharacters());
                        break;
View Full Code Here

Examples of javax.xml.stream.events.XMLEvent.asEndElement()

                    case XMLStreamConstants.START_ELEMENT :
                        depth++;
                        handleStartElement(event.asStartElement());
                        break;
                    case XMLStreamConstants.END_ELEMENT :
                        handleEndElement(event.asEndElement());
                        depth--;
                        break;
                    case XMLStreamConstants.CHARACTERS :
                        handleCharacters(event.asCharacters());
                        break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.