Package javax.xml.stream.events

Examples of javax.xml.stream.events.Attribute


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

    // Get required attributes.
    Attribute titleAtt = startElement.getAttributeByName( CatalogRefElementNames.CatalogRefElement_XlinkTitle );
    String title = titleAtt.getValue();
    Attribute hrefAtt = startElement.getAttributeByName( CatalogRefElementNames.CatalogRefElement_XlinkHref );
    String href = hrefAtt.getValue();
    URI hrefUri = null;
    try
    {
      hrefUri = new URI( href );
    }
View Full Code Here


    }

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

        Attribute typeAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.DateElement_Type );
        String typeString = typeAtt != null ? typeAtt.getValue() : null;

        Attribute formatAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.DateElement_Format );
        String formatString = formatAtt != null ? formatAtt.getValue() : null;


        String date = StaxThreddsXmlParserUtils.getCharacterContent( this.reader, this.elementName );
        ThreddsMetadata.DatePointType type = ThreddsMetadata.DatePointType.getTypeForLabel( typeString );
        if ( type.equals( ThreddsMetadata.DatePointType.Untyped ) || type.equals( ThreddsMetadata.DatePointType.Other) )
View Full Code Here

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

      Attribute typeAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.DocumentationElement_Type );
      Attribute xlinkTitleAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.DocumentationElement_XlinkTitle );
      Attribute xlinkExternalRefAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.DocumentationElement_XlinkHref );

      String type = typeAtt != null ? typeAtt.getValue() : null;
      String xlinkTitle = xlinkTitleAtt != null ? xlinkTitleAtt.getValue() : null;
      String xlinkExternalRef = xlinkExternalRefAtt != null ? xlinkExternalRefAtt.getValue() : null;

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

      if ( xlinkTitle == null && xlinkExternalRef == null )
      {
View Full Code Here

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

    Attribute formatAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.DateType_Format );
    format = formatAtt != null ? formatAtt.getValue() : null;

    Attribute typeAtt = startElement.getAttributeByName( ThreddsMetadataElementNames.DateType_Type );
    type = typeAtt != null ? typeAtt.getValue() : null;

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

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

    return Collections.unmodifiableList( this.metadataInheritedByDescendants);
  }

  void parseStartElementNameAttribute( StartElement startElement )
  {
    Attribute att = startElement.getAttributeByName( DatasetElementNames.DatasetElement_Name );
    if ( att != null )
      this.datasetNodeBuilder.setName( att.getValue() );
  }
View Full Code Here

      this.datasetNodeBuilder.setName( att.getValue() );
  }

  void parseStartElementIdAttribute( StartElement startElement )
  {
    Attribute att = startElement.getAttributeByName( DatasetNodeElementNames.DatasetNodeElement_Id );
    if ( att != null )
      this.datasetNodeBuilder.setId( att.getValue() );
  }
View Full Code Here

      this.datasetNodeBuilder.setId( att.getValue() );
  }

  void parseStartElementIdAuthorityAttribute( StartElement startElement )
  {
    Attribute att = startElement.getAttributeByName( DatasetNodeElementNames.DatasetNodeElement_Authority );
    if ( att != null )
      this.setIdAuthoritySpecifiedInSelf( att.getValue() );
  }
View Full Code Here

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

    Attribute nameAtt = startElement.getAttributeByName( PropertyElementNames.PropertyElement_Name );
    String name = nameAtt.getValue();
    Attribute valueAtt = startElement.getAttributeByName( PropertyElementNames.PropertyElement_Value );
    String value = valueAtt.getValue();

    if ( this.catBuilder != null )
      this.catBuilder.addProperty( name, value );
    else if ( this.datasetNodeBuilder != null )
      this.datasetNodeBuilder.addProperty( name, value );
View Full Code Here

    if ( this.parentDatasetBuilder != null )
      this.selfBuilder = this.parentDatasetBuilder.addAccessBuilder();
    else
      throw new ThreddsXmlParserException( "" );

    Attribute serviceNameAtt = startElement.getAttributeByName( AccessElementNames.AccessElement_ServiceName );
    if ( serviceNameAtt != null )
    {
      String serviceName = serviceNameAtt.getValue();
      ServiceBuilder serviceBuilder = this.parentDatasetBuilder.getParentCatalogBuilder().findServiceBuilderByNameGlobally( serviceName );
      this.selfBuilder.setServiceBuilder( serviceBuilder );
    }

    Attribute urlPathAtt = startElement.getAttributeByName( AccessElementNames.AccessElement_UrlPath );
    String urlPath = urlPathAtt.getValue();

    this.selfBuilder.setUrlPath( urlPath );

    Attribute dataFormatAtt = startElement.getAttributeByName( AccessElementNames.AccessElement_DataFormat );
    if ( dataFormatAtt != null )
    {
      this.selfBuilder.setDataFormat( DataFormatType.getType( dataFormatAtt.getValue() ) );
    }

    return;
  }
View Full Code Here

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

    Attribute nameAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_Name );
    String name = nameAtt.getValue();
    Attribute serviceTypeAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_ServiceType );
    ServiceType serviceType = ServiceType.getType( serviceTypeAtt.getValue() );
    Attribute baseUriAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_Base );
    String baseUriString = baseUriAtt.getValue();
    URI baseUri = null;
    try
    {
      baseUri = new URI( baseUriString );
    }
    catch ( URISyntaxException e )
    {
      log.error( "parseElement(): Bad service base URI [" + baseUriString + "]: " + e.getMessage(), e );
      throw new ThreddsXmlParserException( "Bad service base URI [" + baseUriString + "]", e );
    }
    if ( this.parentCatalogBuilder != null )
      this.selfBuilder = this.parentCatalogBuilder.addService( name, serviceType, baseUri );
    else if ( this.parentServiceBuilder != null )
      this.selfBuilder = this.parentServiceBuilder.addService( name, serviceType, baseUri );
    else
      throw new ThreddsXmlParserException( "" );

    Attribute suffixAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_Suffix );
    if ( suffixAtt != null )
    {
      this.selfBuilder.setSuffix( suffixAtt.getValue() );
    }

    Attribute descriptionAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_Description );
    if ( descriptionAtt != null )
    {
      this.selfBuilder.setSuffix( descriptionAtt.getValue() );
    }
  }
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.