Examples of asEndElement()


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

            //eventReader.next();
          }
        }
        else if ( event.isEndElement())
        {
          log.error( "readCatalogXML(): Unrecognized end element [" + event.asEndElement().getName() + "]." );
          break;
        }
        else
        {
          log.debug( "readCatalogXML(): Unhandled event [" + event.getLocation() + "--" + event + "].");
View Full Code Here

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

    {
      XMLEvent event = xmlEventReader.peek();
      if ( ! event.isEndElement() )
        throw new IllegalStateException( "Next event must be EndElement." );

      if ( ! event.asEndElement().getName().equals( elementName ) )
        throw new IllegalStateException( "End element must be an '" + elementName.getLocalPart() + "' element." );

      xmlEventReader.nextEvent(); // .asEndElement();
    }
    catch ( XMLStreamException e )
View Full Code Here

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

        {
          nameList.add( event.asStartElement().getName() );
        }
        else if ( event.isEndElement() )
        {
          QName endElemName = event.asEndElement().getName();
          QName lastName = nameList.get( nameList.size() - 1 );
          if ( lastName.equals( endElemName ) )
            nameList.remove( nameList.size() - 1 );
          else
          {
View Full Code Here

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

          event = xmlEventReader.nextEvent();
          stringBuilder.append( event.asCharacters().getData());
        }
        else if ( event.isEndElement())
        {
          if ( event.asEndElement().getName().equals( containingElementName ))
          {
            return stringBuilder.toString().trim();
          }
          throw new IllegalStateException( "Badly formed XML? Unexpected end element [" + event.asEndElement().getName().getLocalPart() + "]["+location+"] doesn't match expected start element [" + containingElementName.getLocalPart() + "].");
        }
View Full Code Here

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

        {
          if ( event.asEndElement().getName().equals( containingElementName ))
          {
            return stringBuilder.toString().trim();
          }
          throw new IllegalStateException( "Badly formed XML? Unexpected end element [" + event.asEndElement().getName().getLocalPart() + "]["+location+"] doesn't match expected start element [" + containingElementName.getLocalPart() + "].");
        }
        else if ( event.isStartElement() )
        {
          throw new IllegalStateException( "Badly formed XML? Unexpected start element [" + event.asStartElement().getName().getLocalPart() + "][" + location + "] when characters expected." );
        }
View Full Code Here

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

        {
          this.handleChildStartElement();
        }
        else if ( event.isEndElement() )
        {
          if ( this.isSelfElement( event.asEndElement() ) )
          {
            this.reader.next();
            break;
          }
          else
View Full Code Here

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

          {
            if ( this instanceof ThreddsMetadataElementParser )
            {
              if ( log.isDebugEnabled())
              {
                String msg = "End element probably parent of ThreddsMetadata [" + event.asEndElement().getName() + "].";
                ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils
                        .createIssueForUnexpectedEvent( msg, ThreddsXmlParserIssue.Severity.WARNING,
                                                        this.reader, event );
                // ToDo Figure out a better way to deal with this situation.
                log.debug( "parse(): " + issue.getMessage() );
View Full Code Here

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

                        continue;
                    }
                }
                else if (event.isEndElement())
                {
                    if (event.asEndElement().getName().getLocalPart().equals(ITEM))
                    {
                        // Store the title and link of the first entry we get - the first file on the list is all we need
                        versionTitle = title;
                        versionLink = link;
                        // All done, we don't need to know about older files.
View Full Code Here

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

            if (event != null) {
                if (event.isStartElement()) {
                    result = event.asStartElement().getName();
                }
                else if (event.isEndElement()) {
                    result = event.asEndElement().getName();
                }
            }
        }

        @Override
View Full Code Here

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

                        event.asStartElement().getName().getNamespaceURI());
                assertTrue("eventReader has not next element", eventReader.hasNext());
                event = eventReader.nextEvent();
                assertTrue("Not a end element", event.isEndElement());
                assertEquals("Invalid end event local name", REQUEST_ELEMENT,
                        event.asEndElement().getName().getLocalPart());
                assertEquals("Invalid end event namespace", NAMESPACE_URI,
                        event.asEndElement().getName().getNamespaceURI());
                Namespace namespace = eventFactory.createNamespace(NAMESPACE_URI);
                QName name = new QName(NAMESPACE_URI, RESPONSE_ELEMENT);
                eventWriter
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.