legacy/src/main/java/thredds/catalog/query/DqcFactory.java
private QueryCapability readXML(org.jdom2.Document doc, URI uri) throws IOException {

    if (doc == null) { // parse failed
      QueryCapability dqc = new QueryCapability();
      if (fatalMessages.length() > 0)
        dqc.appendErrorMessage(fatalMessages.toString(), true); // makes it invalid
      if (errMessages.length() > 0)
        dqc.appendErrorMessage(errMessages.toString(), false); // doesnt make it invalid
      if (errMessages.length() > 0)
        dqc.appendErrorMessage(warnMessages.toString(), false); // doesnt make it invalid
      return dqc;
    }

    // decide on converter based on namespace
    Element root = doc.getRootElement();
    String namespace = root.getNamespaceURI();
    DqcConvertIF fac = namespaceToDqcConverterHash.get(namespace);
    if (fac == null) {
      fac = defaultConverter; // LOOK
      if (debugVersion)
        System.out.println("use default converter " + fac.getClass().getName() + "; no namespace " + namespace);
    } else if (debugVersion)
      System.out.println("use converter " + fac.getClass().getName() + " based on namespace " + namespace);

// convert to object model
    QueryCapability dqc = fac.parseXML(this, doc, uri);
    if (fatalMessages.length() > 0)
      dqc.appendErrorMessage(fatalMessages.toString(), true); // makes it invalid
    if (errMessages.length() > 0)
      dqc.appendErrorMessage(errMessages.toString(), false); // doesnt make it invalid
    if (errMessages.length() > 0)
      dqc.appendErrorMessage(warnMessages.toString(), false); // doesnt make it invalid
    return dqc;
  }
private QueryCapability readXML(org.jdom2.Document doc, URI uri) throws IOException {

    if (doc == null) { // parse failed
      QueryCapability dqc = new QueryCapability();
      if (fatalMessages.length() > 0)
        dqc.appendErrorMessage(fatalMessages.toString(), true); // makes it invalid
      if (errMessages.length() > 0)
        dqc.appendErrorMessage(errMessages.toString(), false); // doesnt make it invalid
      if (errMessages.length() > 0)
        dqc.appendErrorMessage(warnMessages.toString(), false); // doesnt make it invalid
      return dqc;
    }

    // decide on converter based on namespace
    Element root = doc.getRootElement();
    String namespace = root.getNamespaceURI();
    DqcConvertIF fac = namespaceToDqcConverterHash.get(namespace);
    if (fac == null) {
      fac = defaultConverter; // LOOK
      if (debugVersion)
        System.out.println("use default converter " + fac.getClass().getName() + "; no namespace " + namespace);
    } else if (debugVersion)
      System.out.println("use converter " + fac.getClass().getName() + " based on namespace " + namespace);

// convert to object model
    QueryCapability dqc = fac.parseXML(this, doc, uri);
    if (fatalMessages.length() > 0)
      dqc.appendErrorMessage(fatalMessages.toString(), true); // makes it invalid
    if (errMessages.length() > 0)
      dqc.appendErrorMessage(errMessages.toString(), false); // doesnt make it invalid
    if (errMessages.length() > 0)
      dqc.appendErrorMessage(warnMessages.toString(), false); // doesnt make it invalid
    return dqc;
  }
private QueryCapability readXML ( org . jdom2 . Document doc , URI uri ) throws IOException { if ( doc == null ) { // parse failed QueryCapability dqc = new QueryCapability ( ) ; if ( fatalMessages . length ( ) > 0 ) dqc . appendErrorMessage ( fatalMessages . toString ( ) , true ) ; // makes it invalid if ( errMessages . length ( ) > 0 ) dqc . appendErrorMessage ( errMessages . toString ( ) , false ) ; // doesnt make it invalid if ( errMessages . length ( ) > 0 ) dqc . appendErrorMessage ( warnMessages . toString ( ) , false ) ; // doesnt make it invalid return dqc ; } // decide on converter based on namespace Element root = doc . getRootElement ( ) ; String namespace = root . getNamespaceURI ( ) ; DqcConvertIF fac = namespaceToDqcConverterHash . get ( namespace ) ; if ( fac == null ) { fac = defaultConverter ; // LOOK if ( debugVersion ) System . out . println ( "use default converter " + fac . getClass ( ) . getName ( ) + "; no namespace " + namespace ) ; } else if ( debugVersion ) System . out . println ( "use converter " + fac . getClass ( ) . getName ( ) + " based on namespace " + namespace ) ; // convert to object model QueryCapability dqc = fac . parseXML ( this , doc , uri ) ; if ( fatalMessages . length ( ) > 0 ) dqc . appendErrorMessage ( fatalMessages . toString ( ) , true ) ; // makes it invalid if ( errMessages . length ( ) > 0 ) dqc . appendErrorMessage ( errMessages . toString ( ) , false ) ; // doesnt make it invalid if ( errMessages . length ( ) > 0 ) dqc . appendErrorMessage ( warnMessages . toString ( ) , false ) ; // doesnt make it invalid return dqc ; }
Create an InvCatalog from an a JDOM document.
check dqc.isValid, dqc.getErrorMessages() to see if ok.

@param doc parse this document
@param uri : the URI of the document, used for resolving reletive references.
@return an InvCatalogImpl object
@throws IOException on failure
Create an InvCatalog from an a JDOM document . check dqc . isValid dqc . getErrorMessages () to see if ok .