/**
   * Creates a new interface file.
   *
   * @return Description of the Returned Value
   */
  private File createInterfaceFile() {
    File newFile = null;
    TypeSummary ts = (TypeSummary) m_summaryList.elementAt(0);
    PackageSummary ps = ts.getPackageSummary();

    if (m_packageName == null) {
      m_packageName = ps.getName();
    }
    CreateNewInterface cni = new CreateNewInterface(ts, m_packageName, m_interfaceName);
    try {
      newFile = cni.run();
    } catch (RefactoringException re) {
      re.printStackTrace();
      return null;
    }
    m_complexTransform.createFile(newFile);
    return newFile;
  }
예제 #2
0
  /**
   * Places the query
   *
   * @param summary the package summary
   * @return the list of types
   */
  public LinkedList query(PackageSummary summary) {
    LinkedList list = new LinkedList();

    Iterator iter = summary.getFileSummaries();
    if (iter != null) {
      while (iter.hasNext()) {
        FileSummary fileSummary = (FileSummary) iter.next();

        if (isIncluded(fileSummary)) {
          add(fileSummary, list);
        }
      }
    }

    return list;
  }
예제 #3
0
 /**
  * Places the query
  *
  * @param packageName the name of the package
  * @return the list of types
  */
 public LinkedList query(String packageName) {
   return query(PackageSummary.getPackageSummary(packageName));
 }
 /**
  * Adds a class that will implement the new interface
  *
  * @param packageName The feature to be added to the ImplementingClass attribute
  * @param className The feature to be added to the ImplementingClass attribute
  */
 public void addImplementingClass(String packageName, String className) {
   TypeSummary summary =
       GetTypeSummary.query(PackageSummary.getPackageSummary(packageName), className);
   addImplementingClass(summary);
 }