Examples of StartElement


Examples of javax.xml.stream.events.StartElement

  }

  void parseStartElement()
          throws ThreddsXmlParserException
  {
    StartElement startElement = this.getNextEventIfStartElementIsMine();
      
    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() ) );
    }
View Full Code Here

Examples of javax.xml.stream.events.StartElement

  }

  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

Examples of javax.xml.stream.events.StartElement

  }

  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

Examples of javax.xml.stream.events.StartElement

  }

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

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

Examples of javax.xml.stream.events.StartElement

  }

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

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

Examples of javax.xml.stream.events.StartElement

        if (o == this) return true;
        if (o == null) return false;

        if (!(o instanceof StartElement)) return false;

        StartElement other = (StartElement) o;

        // First things first: names must match
        if (mName.equals(other.getName())) {
            /* Rest is much trickier. I guess the easiest way is to
             * just blindly iterate through ns decls and attributes.
             * The main issue is whether ordering should matter; it will,
             * if just iterating. Would need to sort to get canonical
             * comparison.
             */
            if (iteratedEquals(getNamespaces(), other.getNamespaces())) {
                return iteratedEquals(getAttributes(), other.getAttributes());
            }
        }
        return false;
    }
View Full Code Here

Examples of javax.xml.stream.events.StartElement

        if (o == this) return true;
        if (o == null) return false;

        if (!(o instanceof StartElement)) return false;

        StartElement other = (StartElement) o;

        // First things first: names must match
        if (mName.equals(other.getName())) {
            /* Rest is much trickier. I guess the easiest way is to
             * just blindly iterate through ns decls and attributes.
             * The main issue is whether ordering should matter; it will,
             * if just iterating. Would need to sort to get canonical
             * comparison.
             */
            if (iteratedEquals(getNamespaces(), other.getNamespaces())) {
                return iteratedEquals(getAttributes(), other.getAttributes());
            }
        }
        return false;
    }
View Full Code Here

Examples of javax.xml.stream.events.StartElement

        }
        assertNotNull(evtWriter);
       
        try {
            XMLEventFactory factory = XMLEventFactory.newInstance();
            StartElement startEl = factory.createStartElement(obj.getName(), null, null);
            evtWriter.add(startEl);
            staxObject.writeObjectToStax(obj, evtWriter, factory);
            EndElement endEl = factory.createEndElement(obj.getName(), null);
            evtWriter.add(endEl);
            evtWriter.flush();
View Full Code Here

Examples of javax.xml.stream.events.StartElement

        }
        assertNotNull(evtWriter);
       
        try {
            XMLEventFactory factory = XMLEventFactory.newInstance();
            StartElement startEl = factory.createStartElement(obj.getName(), null, null);
            evtWriter.add(startEl);
            staxObject.writeObjectToStax(obj, evtWriter, factory);
            EndElement endEl = factory.createEndElement(obj.getName(), null);
            evtWriter.add(endEl);
            evtWriter.flush();
View Full Code Here

Examples of javax.xml.stream.events.StartElement

                                                       QName idlType,
                                                       TypeCode tc,
                                                       XmlSchemaObject schemaType)
        throws CorbaBindingException {
        try {
            StartElement startEl = reader.nextEvent().asStartElement();
            QName name = startEl.getName();
            XMLEvent evt = reader.nextEvent();
            Characters charEl;
            if (evt.isStartElement()) {
                charEl = reader.nextEvent().asCharacters();
            } else {
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.