Package thredds.catalog2.xml.parser

Examples of thredds.catalog2.xml.parser.ThreddsXmlParserIssue


    }
    catch ( XMLStreamException e )
    {
      String msg = "Problem reading XML stream.";
      log.warn( "readNextEventCheckItIsEndElementWithExpectedName(): " + msg, e );
      throw new ThreddsXmlParserException( new ThreddsXmlParserIssue( ThreddsXmlParserIssue.Severity.FATAL, msg, null, e ) );
    }
  }
View Full Code Here


          throws ThreddsXmlParserException
  {
    String locationInfo = getLocationInfo( xmlEventReader);
    String msg = message + ":\n    " + locationInfo + ": " + e.getMessage();
    log.debug( "createIssueForException(): " + msg );
    return new ThreddsXmlParserIssue( ThreddsXmlParserIssue.Severity.WARNING, msg, null, e );
  }
View Full Code Here

  {
    String locationInfo = getLocationInfo( xmlEventReader);
    String unexpectedElemAsString = StaxThreddsXmlParserUtils.consumeElementAndConvertToXmlString( xmlEventReader );
    String msg = message + ":\n    " + locationInfo + ":\n" + unexpectedElemAsString;
    log.debug( "createIssueForUnexpectedElement(): " + msg );
    return new ThreddsXmlParserIssue( ThreddsXmlParserIssue.Severity.WARNING, msg, null, null );
  }
View Full Code Here

          throws ThreddsXmlParserException
  {
    String locationInfo = getLocationInfo( xmlEventReader);
    String msg = message + " [" + severity.toString() + "]:\n    " + locationInfo + ":\n";
    log.debug( "createIssueForUnexpectedElement(): " + msg );
    return new ThreddsXmlParserIssue( severity, msg, null, null );
  }
View Full Code Here

        else if ( type.equals( ThreddsMetadata.DatePointType.MetadataModified ) )
            this.threddsMetadataBuilder.setMetadataModifiedDatePointBuilder( date, formatString );
        else
        {
            String msg = "Unsupported DatePointType [" + typeString + "].";
            ThreddsXmlParserIssue parserIssue = StaxThreddsXmlParserUtils
                    .createIssueForUnexpectedEvent( msg, ThreddsXmlParserIssue.Severity.WARNING, this.reader, startElement );
            log.error( "parseStartElement(): " + parserIssue.getMessage() );
            throw new ThreddsXmlParserException( parserIssue );
        }

    }
View Full Code Here

            if ( this instanceof ThreddsMetadataElementParser )
            {
              if ( log.isDebugEnabled())
              {
                String msg = "End element probably parent of ThreddsMetadata [" + event.asEndElement().getName() + "].";
                ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils
                        .createIssueForUnexpectedEvent( msg, ThreddsXmlParserIssue.Severity.WARNING,
                                                        this.reader, event );
                // ToDo Figure out a better way to deal with this situation.
                log.debug( "parse(): " + issue.getMessage() );
              }
              break;
            }
            else
            {
              String msg = "Unrecognized end element [" + event.asEndElement().getName() + "].";
              ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils
                      .createIssueForUnexpectedEvent( msg, ThreddsXmlParserIssue.Severity.FATAL,
                                                      this.reader, event );
              log.error( this.getClass().getName() + ".parse(): " + issue.getMessage() );
              // ToDo Gather issues (and "this.reader.next(); continue;") rather than throw exception.
              throw new ThreddsXmlParserException( issue );
            }
          }
        }
View Full Code Here

        event = this.reader.peek();
      }
      catch (XMLStreamException e)
      {
        String msg = "Problem reading from XMLEventReader.";
        ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils
                .createIssueForException( msg, this.reader, e);
        log.error("peekAtNextEventIfStartElement(): " + issue.getMessage());
        // ToDo Gather issues rather than throw exception.
        throw new ThreddsXmlParserException(issue);
      }

      if (event.isStartElement())
      {
        startElement = event.asStartElement();
        break;
      }
      else if( event.isCharacters() && event.asCharacters().isWhiteSpace())
      {
        // Skip any whitespace characters.
        this.reader.next();
      }
      else
      {
        String msg = "Expecting StartElement for next event [" + event.getClass().getName() + "]";
        ThreddsXmlParserIssue issue = StaxThreddsXmlParserUtils
                .createIssueForUnexpectedEvent( msg, ThreddsXmlParserIssue.Severity.FATAL, this.reader,event );
        log.error( "peekAtNextEventIfStartElement(): " + issue.getMessage());
          // ToDo Gather issues rather than throw exception.
        throw new ThreddsXmlParserException( issue );
      }
    }
View Full Code Here

  void handleChildStartElement()
          throws ThreddsXmlParserException
  {
    String unexpectedElement = StaxThreddsXmlParserUtils.consumeElementAndConvertToXmlString( this.reader );
    ThreddsXmlParserIssue issue = new ThreddsXmlParserIssue( ThreddsXmlParserIssue.Severity.ERROR, "Unrecognized element: " + unexpectedElement, this.selfBuilder, null);
    throw new ThreddsXmlParserException( issue);
  }
View Full Code Here

      elementParser.parse();
    }
    else
    {
      String unexpectedElement = StaxThreddsXmlParserUtils.consumeElementAndConvertToXmlString( this.reader );
      ThreddsXmlParserIssue issue = new ThreddsXmlParserIssue( ThreddsXmlParserIssue.Severity.ERROR, "Unrecognized element: " + unexpectedElement, this.selfBuilder, null);
      throw new ThreddsXmlParserException( issue);
    }

  }
View Full Code Here

      return cp.parseIntoBuilder( new StringReader( catalogXml ), docBaseUri );
    }

    public static void writeCatalogXml( Catalog cat )
    {
        ThreddsXmlWriter txw = ThreddsXmlWriterFactory.newInstance().createThreddsXmlWriter();
        try {
            txw.writeCatalog( cat, System.out );
        }
        catch ( ThreddsXmlWriterException e )
        {
            e.printStackTrace();
            fail( "Failed writing catalog to sout: " + e.getMessage() );
View Full Code Here

TOP

Related Classes of thredds.catalog2.xml.parser.ThreddsXmlParserIssue

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.