コード例 #1
0
  /**
   * _more_
   *
   * @param entry _more_
   * @param className _more_
   * @param properties _more_
   * @return _more_
   * @throws Exception _more_
   */
  private RecordFile doMakeRecordFile(Entry entry, String className, Hashtable properties)
      throws Exception {
    Class c = Misc.findClass(className);
    Constructor ctor = Misc.findConstructor(c, new Class[] {String.class, Hashtable.class});
    if (ctor != null) {
      return (RecordFile) ctor.newInstance(new Object[] {entry.getFile().toString(), properties});
    }
    ctor = Misc.findConstructor(c, new Class[] {String.class});

    if (ctor != null) {
      return (RecordFile) ctor.newInstance(new Object[] {entry.getResource().getPath()});
    }

    throw new IllegalArgumentException("Could not find constructor for " + className);
  }