Package javax.xml.stream.events

Examples of javax.xml.stream.events.StartElement


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

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


  }

  void parseStartElement()
          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 handleChildStartElement()
          throws ThreddsXmlParserException
  {
    StartElement startElement = this.peekAtNextEventIfStartElement();

    if ( this.datasetNodeElementParserHelper.handleBasicChildStartElement( startElement, this.reader, this.selfBuilder ))
      return;
    else
      // ToDo Save the results in a ThreddsXmlParserIssue (Warning) and report.
View Full Code Here

  void parseStartElement()
          throws ThreddsXmlParserException
  {
    // ThreddsMetadata container object only, no self element exists!
    // So peek at next event to see how to route it.
    StartElement startElement = this.peekAtNextEventIfStartElement();

    if ( this.serviceNameParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.serviceNameParserFactory.getNewParser( this.reader, this.builderFactory,
                                                                         this.selfBuilder,
                                                                         this.parentDatasetNodeElementParserHelper,
                                                                         this.inheritedByDescendants );
    else if ( this.dataFormatParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.dataFormatParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.dataTypeParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.dataTypeParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.dateParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.dateParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.authorityParserFactory.isEventMyStartElement( startElement ) )
    {
      this.delegate = this.authorityParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder,
                                                                this.parentDatasetNodeElementParserHelper,
                                                                this.inheritedByDescendants );
    }
    else if ( this.documentationParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.documentationParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.keyphraseParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.keyphraseParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.projectNameParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.projectNameParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.creatorParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.creatorParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.publisherParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.publisherParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.contribParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.contribParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.timeCovParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.timeCovParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else if ( this.variableGroupParserFactory.isEventMyStartElement( startElement ) )
      this.delegate = this.variableGroupParserFactory.getNewParser( this.reader, this.builderFactory, this.selfBuilder );
    else
      throw new ThreddsXmlParserException( "Not a recognized ThreddsMetadata child element [" + startElement.getName().getLocalPart() + "]." );

    this.delegate.parseStartElement();
  }
View Full Code Here

    }

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

      String dataFormat = StaxThreddsXmlParserUtils.getCharacterContent( this.reader, ThreddsMetadataElementNames.DataFormatElement );
      this.threddsMetadataBuilder.setDataFormat( dataFormat );
    }
View Full Code Here

    ThreddsBuilder getSelfBuilder() {
      return null;
    }

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

        String dataType = StaxThreddsXmlParserUtils.getCharacterContent( this.reader,
                                                                         ThreddsMetadataElementNames.DataTypeElement );
        this.threddsMetadataBuilder.setDataType( dataType );
    }
View Full Code Here

    ThreddsBuilder getSelfBuilder() {
      return null;
    }

    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 );
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;
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

  }

  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 )
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.