Package javax.xml.stream.events

Examples of javax.xml.stream.events.StartElement


  }

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

    Attribute nameAtt = startElement.getAttributeByName( DatasetElementNames.DatasetElement_Name );
    String name = nameAtt.getValue();

    if ( this.parentCatalogBuilder != null )
      this.selfBuilder = this.parentCatalogBuilder.addDataset( name );
    else if ( this.parentDatasetNodeBuilder != null )
      this.selfBuilder = this.parentDatasetNodeBuilder.addDataset( name );
    else if ( builderFactory != null )
      this.selfBuilder = builderFactory.newDatasetBuilder( name );
    else
      throw new ThreddsXmlParserException( "" );

    this.datasetNodeElementParserHelper = new DatasetNodeElementParserHelper( this.parentDatasetNodeElementParserHelper,
                                                                              this.selfBuilder,
                                                                              this.builderFactory );

    this.datasetNodeElementParserHelper.parseStartElementIdAttribute( startElement );
    this.datasetNodeElementParserHelper.parseStartElementIdAuthorityAttribute( startElement );

    Attribute serviceNameAtt = startElement.getAttributeByName( DatasetElementNames.DatasetElement_ServiceName );
    if ( serviceNameAtt != null )
      this.setDefaultServiceName( serviceNameAtt.getValue() );

    Attribute urlPathAtt = startElement.getAttributeByName( DatasetElementNames.DatasetElement_UrlPath );
    if ( urlPathAtt != null )
    {
      // Add AccessBuilder and set urlPath, set ServiceBuilder in postProcessingAfterEndElement().
      AccessBuilder accessBuilder = this.selfBuilder.addAccessBuilder();
      accessBuilder.setUrlPath( urlPathAtt.getValue() );
View Full Code Here


    }
  }

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

    if ( this.datasetNodeElementParserHelper.handleBasicChildStartElement( startElement, this.reader, this.selfBuilder ))
      return;
    else if ( this.datasetNodeElementParserHelper.handleCollectionChildStartElement( startElement, this.reader, this.selfBuilder ))
      return;
View Full Code Here

  }

  void parseStartElement()
          throws ThreddsXmlParserException
  {
    StartElement startElement = this.getNextEventIfStartElementIsMine();
    Attribute roleAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.ContributorElement_Role );
    String role = roleAtt != null ? roleAtt.getValue() : null;

    String name = StaxThreddsXmlParserUtils.getCharacterContent( this.reader,
                                                                 this.elementName );
    this.selfBuilder = this.parentBuilder.addContributor();
View Full Code Here

  }

  void parseStartElement()
          throws ThreddsXmlParserException
  {
    StartElement startElement = this.getNextEventIfStartElementIsMine();
    Attribute roleAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.ControlledVocabType_Authority );
    String role = roleAtt != null ? roleAtt.getValue() : null;

    String name = StaxThreddsXmlParserUtils.getCharacterContent( this.reader,
                                                                 this.elementName );
    this.selfBuilder = this.parentBuilder.addKeyphrase( role, name);
View Full Code Here

      return null;
    }

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

      Attribute namingAuthAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.CreatorElement_NameElement_NamingAuthority );
      String namingAuth = namingAuthAtt != null ? namingAuthAtt.getValue() : null;

      String name = StaxThreddsXmlParserUtils.getCharacterContent( this.reader, this.elementName );

      this.parentBuilder.setName( name );
View Full Code Here

      return null;
    }

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

      Attribute emailAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.CreatorElement_ContactElement_Email );
      String emailAuth = emailAtt != null ? emailAtt.getValue() : null;
      Attribute urlAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.CreatorElement_ContactElement_Url );
      String url = urlAtt != null ? urlAtt.getValue() : null;

      this.parentBuilder.setEmail( emailAuth );
      this.parentBuilder.setWebPage( url );
    }
View Full Code Here

  }

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

    if ( this.nameElemParserFactory.isEventMyStartElement( startElement ) )
    {
      CreatorElementParser.NameElementParser elementParser
              = this.nameElemParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
View Full Code Here

  }

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

    this.selfBuilder = this.parentBuilder.addVariableGroupBuilder();

    Attribute att = startElement.getAttributeByName( ThreddsMetadataElementNames.VariablesElement_vocabAuthorityId );
    if ( att != null )
      this.selfBuilder.setVocabularyAuthorityIdatt.getValue() );

    att = startElement.getAttributeByName( ThreddsMetadataElementNames.VariablesElement_vocabAuthorityUrl );
    if ( att != null)
      this.selfBuilder.setVocabularyAuthorityUrl( att.getValue());
  }
View Full Code Here

  }

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

    if ( this.varElemParserFactory.isEventMyStartElement( startElement ))
    {
      this.varElemParser = this.varElemParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
      this.varElemParser.parseElement();
View Full Code Here

    }

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

      Attribute att = startElement.getAttributeByName( ThreddsMetadataElementNames.VariablesElement_VariableElement_name );
      String name = att != null ? att.getValue() : null;

      att = startElement.getAttributeByName( ThreddsMetadataElementNames.VariablesElement_VariableElement_units );
      String units = att != null ? att.getValue() : null;

      att = startElement.getAttributeByName( ThreddsMetadataElementNames.VariablesElement_VariableElement_vocabularyId );
      String vocabularyId = att != null ? att.getValue() : null;

      att = startElement.getAttributeByName( ThreddsMetadataElementNames.VariablesElement_VariableElement_vocabularyName );
      String vocabularyName = att != null ? att.getValue() : null;

      String description = StaxThreddsXmlParserUtils.getCharacterContent( this.reader, this.elementName );

      this.selfBuilder = parentBuilder.addVariableBuilder( name, description, units, vocabularyId, vocabularyName );
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.