Package nz.govt.natlib.adapter

Examples of nz.govt.natlib.adapter.DataAdapter


  public static void parseFile(File file, int con) throws Exception {

    Config.getInstance();

    DataAdapter adapter = AdapterFactory.getInstance().getAdapter(file);

    if (adapter != null) {
      System.out.println("Adaper");
      System.out.println("  Name :" + adapter.getName());
      System.out.println("  Version :" + adapter.getVersion());
      System.out.println("  Description :" + adapter.getDescription());
      Configuration config = (Configuration) Config.getInstance()
          .getAvailableConfigs().get(con);
      System.out.println("Using Configuration :" + config.getName());
      File outDir = new File(config.getOutputDirectory());
      outDir.mkdirs(); // precaution, in case the directories are not
View Full Code Here


  }

  public DataAdapter getAdapter(String className) {
    Iterator it = adapters.iterator();
    while (it.hasNext()) {
      DataAdapter da = (DataAdapter) it.next();
      if (da.getClass().getName().equals(className)) {
        return da;
      }
    }
    return null;
  }
View Full Code Here

   */
  public DataAdapter getAdapter(File file, String output) {
    // ask each adapter if it does this file?
    Iterator it = adapters.iterator();
    while (it.hasNext()) {
      DataAdapter adapter = (DataAdapter) it.next();
      if ((output == null || adapter.getOutputType().equals(output))
          && Config.getInstance().getCurrentProfile().hasAdapter(
              adapter) && (adapter.acceptsFile(file))) {
        return adapter;
      }
    }
    if ((defaultAdapter != null)
        && (output == null || defaultAdapter.getOutputType().equals(
View Full Code Here

        && (defaultAdapter.getClass().getName().equals(adapterClass))) {
      return true;
    }
    Iterator it = adapters.iterator();
    while (it.hasNext()) {
      DataAdapter adapter = (DataAdapter) it.next();
      if (adapter.getClass().getName().equals(adapterClass)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of nz.govt.natlib.adapter.DataAdapter

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.