Package javax.xml.parsers

Examples of javax.xml.parsers.ParserConfigurationException


    render(fd, dataRepo, out, root, lenses);

    return out;
  }
  catch (Exception e) {
    throw new ParserConfigurationException("Rendering only supported for Sesame");
  }
}


    String[] lURIA = new String[1];
    lURIA[0] = lensURI;
    return render(fd, dataRepo, lURIA);
  }
  catch (Exception e) {
    throw new ParserConfigurationException("Rendering only supported for Sesame");
  }
}

    }

    return out;
  }
  catch (Exception e) {
    throw new ParserConfigurationException("Rendering only supported for Sesame");
  }
}

        */
      }
      else if (end instanceof Statement)
      {
        String error = "Render Error: SPARQL query must end on node";
        throw new ParserConfigurationException(error);
      }
    }
    }
  }
  else if (renderLens.getFSLInstanceDomains() != null)
  {
    FSLPath[] fid = renderLens.getFSLInstanceDomains();
    SesameLens sl = (SesameLens)renderLens;
    FSLSesameEvaluator fse = new FSLSesameEvaluator();
    fse.setDataRepository(dataRepo);
    for (int i = 0; i < fid.length; i++)
    {
      Vector pathInstances = fse.evaluatePath(fid[i]);
      for (int k=0; k<pathInstances.size(); k++) {
      Object end = ((Vector)pathInstances.get(k)).get(0);
      if (end instanceof Resource)
      {
        Resource r = (Resource)end;
        Element eR = createResourceElement(fd, dataRepo, doc, sl, null, r, Constants.DEFAULT_MAX_DEPTH);
        parent.appendChild(eR);
      }
     
      else if (end instanceof Literal)
      {
        Literal l = (Literal)end;
        ValueFactory f = dataRepo.getValueFactory();
        URI r = f.createURI(l.getLabel());
        if (r == null)
          continue;
        Element eR = createResourceElement(fd, dataRepo, doc, sl, null, r, Constants.DEFAULT_MAX_DEPTH);
        parent.appendChild(eR);
      }
      else if (end instanceof Statement)
      {
        String error = "Render Error: FSL path must end on node";
        throw new ParserConfigurationException(error);
      }
      }
    }
  }
  else if (renderLens.getBasicInstanceDomains() != null)

      this.render(fd, dataRepo, out, root, lenses, offset, limit);

      return out;
    }
    catch (Exception e) {
      throw new ParserConfigurationException("Rendering only supported for Sesame");
    }
  }

      String[] lURIA = new String[1];
      lURIA[0] = lensURI;
      return this.render(fd, dataRepo, lURIA, offset, limit);
    }
    catch (Exception e) {
      throw new ParserConfigurationException("Rendering only supported for Sesame");
    }
  }

      }

      return out;
    }
    catch (Exception e) {
      throw new ParserConfigurationException("Rendering only supported for Sesame");
    }
  } 

              parent.appendChild(eR);
            }
            else if (end instanceof Statement)
            {
              String error = "Render Error: SPARQL query must end on node";
              throw new ParserConfigurationException(error);
            }
          }         
        }else{       
          //return values without metadata
          fr.inria.jfresnel.sparql.sesame.SPARQLSesameEvaluator fsse = new fr.inria.jfresnel.sparql.sesame.SPARQLSesameEvaluator();     
          fsse.setDataRepository(dataRepo);
          Vector queryResults = fsse.evaluateQuery(new SPARQLQuery(query));
          for (int k=0; k<queryResults.size(); k++) {
            Object end = queryResults.get(k);
            //resources++;
            if (end instanceof Resource)
            {
              Resource r = (Resource)end;
              Element eR = createResourceElement(fd, dataRepo, doc, sl, null, r, Constants.DEFAULT_MAX_DEPTH);
              parent.appendChild(eR);
            }
            else if (end instanceof Literal)
            {
              Literal l = (Literal)end;
              ValueFactory f = dataRepo.getValueFactory();
              URI r = f.createURI(l.getLabel());
              if (r == null)
                continue;
              Element eR = createResourceElement(fd, dataRepo, doc, sl, null, r, Constants.DEFAULT_MAX_DEPTH);
              parent.appendChild(eR);
            }
            else if (end instanceof Statement)
            {
              String error = "Render Error: SPARQL query must end on node";
              throw new ParserConfigurationException(error);
            }
          }
        }
      }
    }
    //still not extended to return results with metadata!
    else if (renderLens.getFSLInstanceDomains() != null)
    {
      System.out.println("Rendering getFSLInstanceDomains()...");
      FSLPath[] fid = renderLens.getFSLInstanceDomains();
      SesameLens sl = (SesameLens)renderLens;     
      FSLSesameEvaluator fse = new FSLSesameEvaluator();
      fse.setDataRepository(dataRepo);
      for (int i = 0; i < fid.length; i++)
      {
        //resources ++;
        Vector pathInstances = fse.evaluatePath(fid[i]);
        for (int k=0; k<pathInstances.size(); k++) {
        Object end = ((Vector)pathInstances.get(k)).get(0);
       
        if (end instanceof Resource)
        {
          Resource r = (Resource)end;
          Element eR = createResourceElement(fd, dataRepo, doc, sl, null, r, Constants.DEFAULT_MAX_DEPTH);         
          parent.appendChild(eR);
        }
       
        else if (end instanceof Literal)
        {
          Literal l = (Literal)end;
          ValueFactory f = dataRepo.getValueFactory();
          URI r = f.createURI(l.getLabel());
          if (r == null)
            continue;
          Element eR = createResourceElement(fd, dataRepo, doc, sl, null, r, Constants.DEFAULT_MAX_DEPTH);
          parent.appendChild(eR);
        }
        else if (end instanceof Statement)
        {
          String error = "Render Error: FSL path must end on node";
          throw new ParserConfigurationException(error);
        }
        }
      }
    }
    // I don't know if here it should be return metadata here !!!

        XmlValidationModeDetector.VALIDATION_NONE, false);

      return (DomUtils.getChildElementValueByTagName(document.getDocumentElement(), LOCAL_REPOSITORY_ELEM));
    }
    catch (Exception ex) {
      throw (RuntimeException) new RuntimeException(new ParserConfigurationException("error parsing resource="
          + m2Settings).initCause(ex));
    }
  }

      else {
        return groupId;
      }
    }
    catch (Exception ex) {
      throw (RuntimeException) new RuntimeException(new ParserConfigurationException("error parsing resource="
          + pomXml).initCause(ex));
    }

    throw new IllegalArgumentException("no groupId or parent/groupId defined by resource ["
        + pomXml.getDescription() + "]");

TOP

Related Classes of javax.xml.parsers.ParserConfigurationException

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.