Package javax.xml.stream.events

Examples of javax.xml.stream.events.StartElement


          throws ThreddsXmlParserException
  {
    if ( ! this.reader.hasNext() )
      throw new ThreddsXmlParserException( "XMLEventReader has no further events." );

    StartElement startElement = null;
    try
    {
      XMLEvent event = this.reader.peek();
      if ( ! event.isStartElement() )
        throw new ThreddsXmlParserException( "Next event must be StartElement." );
View Full Code Here


          throws ThreddsXmlParserException
  {
    if ( ! this.reader.hasNext() )
      throw new ThreddsXmlParserException( "XMLEventReader has no further events." );

    StartElement startElement = null;
    while ( this.reader.hasNext() )
    {
      XMLEvent event = null;
      try
      {
View Full Code Here

  }

  void handleChildStartElement()
          throws ThreddsXmlParserException
  {
    StartElement startElement = this.peekAtNextEventIfStartElement();

    if ( this.startElementParserFactory.isEventMyStartElement( startElement ) )
    {
      this.startElementParser = this.startElementParserFactory.getNewDateTypeParser();
      this.startElementParser.parseElement( this.reader );
View Full Code Here

  }

  @Override
  void handleChildStartElement() throws ThreddsXmlParserException
  {
    StartElement startElement = this.peekAtNextEventIfStartElement();

    if ( this.startFac.isEventMyStartElement( startElement ))
    {
      CharContentOnlyElementParser startParser = this.startFac.getParser();
      startParser.parseElement( this.reader );
View Full Code Here

    }

    void parseElement( XMLEventReader reader )
            throws ThreddsXmlParserException
    {
      StartElement startElement = StaxThreddsXmlParserUtils.readNextEventCheckItIsStartElementWithExpectedName( reader, this.elementName );

      value = StaxThreddsXmlParserUtils.getCharacterContent( reader, this.elementName );

      StaxThreddsXmlParserUtils.readNextEventCheckItIsEndElementWithExpectedName( reader, this.elementName );
    }
View Full Code Here

  }

  void parseElement( XMLEventReader reader )
          throws ThreddsXmlParserException
  {
    StartElement startElement = StaxThreddsXmlParserUtils.readNextEventCheckItIsStartElementWithExpectedName( reader, this.elementName );

    Attribute vocabAuthAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.ControlledVocabType_Authority );
    vocabAuth = vocabAuthAtt != null ? vocabAuthAtt.getValue() : null;

    value = StaxThreddsXmlParserUtils.getCharacterContent( reader, this.elementName );

    StaxThreddsXmlParserUtils.readNextEventCheckItIsEndElementWithExpectedName( reader, this.elementName );
View Full Code Here

  }

  void parseStartElement()
          throws ThreddsXmlParserException
  {
    StartElement startElement = this.getNextEventIfStartElementIsMine();

    // Determine if this metadata element gets inherited.
    Attribute inheritedAtt = startElement.getAttributeByName( MetadataElementNames.MetadataElement_Inherited );
    if ( inheritedAtt != null && inheritedAtt.getValue().equalsIgnoreCase( "true" ) )
      this.isInheritedByDescendants = true;

    // If contains "threddsMetadataGroup" elements, drop metadata wrapper
    StartElement nextElement = this.peekAtNextEventIfStartElement();

    if ( this.threddsMetadataElementParserFactory.isEventMyStartElement( nextElement ) )
    {
      this.containsThreddsMetadata = true;
      return;
View Full Code Here

  }

  void handleChildStartElement()
          throws ThreddsXmlParserException
  {
    StartElement startElement = this.peekAtNextEventIfStartElement();

    if ( this.containsThreddsMetadata )
    {
      if ( this.threddsMetadataElementParserFactory.isEventMyStartElement( startElement ) )
      {
View Full Code Here

  }

  void parseStartElement( )
          throws ThreddsXmlParserException
  {
    StartElement startElement = this.getNextEventIfStartElementIsMine();

    Attribute nameAtt = startElement.getAttributeByName( CatalogElementNames.CatalogElement_Name );
    String nameString = nameAtt != null ? nameAtt.getValue() : null ;

    Attribute versionAtt = startElement.getAttributeByName( CatalogElementNames.CatalogElement_Version );
    String versionString = versionAtt != null ? versionAtt.getValue() : null;
    Attribute expiresAtt = startElement.getAttributeByName( CatalogElementNames.CatalogElement_Expires );
    String expiresString = expiresAtt != null ? expiresAtt.getValue() : null;
    DateType expires = null;
    try {
      expires = expiresString != null ? new DateType( expiresString, null, null ) : null;
    }
    catch ( ParseException e )
    {
      String msg = "Failed to parse catalog expires date [" + expiresString + "].";
      ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils.createIssueForException( msg, this.reader, e );
      log.warn( "parseStartElement(): " + issue.getMessage(), e );
      // ToDo Gather issues rather than throw exception.
      throw new ThreddsXmlParserException( issue );
    }
    Attribute lastModifiedAtt = startElement.getAttributeByName( CatalogElementNames.CatalogElement_LastModified );
    String lastModifiedString = lastModifiedAtt != null ? lastModifiedAtt.getValue() : null;
    DateType lastModified = null;
    try {
      lastModified = lastModifiedString != null ? new DateType( lastModifiedString, null, null ) : null;
    }
View Full Code Here

  }

  void handleChildStartElement()
          throws ThreddsXmlParserException
  {
    StartElement startElement = this.peekAtNextEventIfStartElement();

    if ( this.serviceElemParserFactory.isEventMyStartElement( startElement ) )
    {
      ServiceElementParser serviceElemParser = this.serviceElemParserFactory.getNewParser( reader,
                                                                                           this.builderFactory,
View Full Code Here

TOP

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

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.