Package no.priv.garshol.duke

Examples of no.priv.garshol.duke.DukeConfigException


      SparqlResult result = runQuery(endpoint, thisquery);
      variables = result.getVariables();
      page = result.getRows();

      if (triple_mode && !page.isEmpty() && page.get(0).length != 3)
        throw new DukeConfigException("In triple mode SPARQL queries must " +
                                      "produce exactly three columns!");

      if (logger != null)
        logger.debug("SPARQL result rows: " + page.size());
View Full Code Here


    public Record next() {
      String resource = page.get(pagerow)[0];

      Collection<Column> cols = columns.get("?uri");
      if (cols == null)
        throw new DukeConfigException("No '?uri' column. It's required in triple mode");
      Column uricol = cols.iterator().next();

      builder.newRecord();
      builder.setValue(uricol, resource);
View Full Code Here

  protected abstract String getSourceName();
 
  protected void verifyProperty(String value, String name) {
    if (value == null)
      throw new DukeConfigException("Missing '" + name + "' property to " +
                                    getSourceName() + " data source");
  }
View Full Code Here

    name = name.toUpperCase();
    Object c[] = klass.getEnumConstants();
    for (int ix = 0; ix < c.length; ix++)
      if (c[ix].toString().equals(name))
        return c[ix];
    throw new DukeConfigException("No such " + klass + ": '" + name + "'");
  }
View Full Code Here

        methods[ix].invoke(object, convertToType(value, type, objects));
        found = true;
      }

      if (!found)
        throw new DukeConfigException("Couldn't find method '" + prop + "' in " +
                                      "class " + object.getClass());
    } catch (IllegalArgumentException e) {
      throw new DukeConfigException("Couldn't set bean property " + prop +
                                    " on object of class " + object.getClass() +
                                    ": " + e);
    } catch (IllegalAccessException e) {
      throw new DukeException(e);
    } catch (InvocationTargetException e) {
      throw new DukeConfigException("Couldn't set bean property " + prop +
                                    " on object of class " + object.getClass() +
                                    ": " + e);
    }
  }
View Full Code Here

      return Double.parseDouble(value);
    else if (type == Float.TYPE)
      return Float.parseFloat(value);
    else if (type == Character.TYPE) {
      if (value.length() != 1)
        throw new DukeConfigException("String '" + value + "' is not a character");
      return new Character(value.charAt(0));
    } else if (type.isEnum())
      return getEnumConstantByName(type, value);
    else if (type.equals(Collection.class)) {
      Collection coll = new ArrayList();
View Full Code Here

    Document doc = new Document();
    for (String propname : record.getProperties()) {
      Property prop = config.getPropertyByName(propname);
      if (prop == null)
        throw new DukeConfigException("Record has property " + propname +
                                      " for which there is no configuration");

      if (prop.getComparator() instanceof GeopositionComparator &&
          geoprop != null) {
        // index specially as geocoordinates
View Full Code Here

    if (dbtype.equals("jdbc"))
      return makeJDBCLinkDatabase(props);
    else if (dbtype.equals("jndi"))
      return makeJNDILinkDatabase(props);
    else
      throw new DukeConfigException("Unknown link database type '" + dbtype +
                                    "'");
  }
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.DukeConfigException

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.