Java Code Examples for org.objectweb.asm.ClassVisitor#visitModule()

The following examples show how to use org.objectweb.asm.ClassVisitor#visitModule() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModuleNode.java    From Cafebabe with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Makes the given class visitor visit this module.
 *
 * @param classVisitor
 *          a class visitor.
 */
public void accept(final ClassVisitor classVisitor) {
	ModuleVisitor moduleVisitor = classVisitor.visitModule(name, access, version);
	if (moduleVisitor == null) {
		return;
	}
	if (mainClass != null) {
		moduleVisitor.visitMainClass(mainClass);
	}
	if (packages != null) {
		for (int i = 0, n = packages.size(); i < n; i++) {
			moduleVisitor.visitPackage(packages.get(i));
		}
	}
	if (requires != null) {
		for (int i = 0, n = requires.size(); i < n; i++) {
			requires.get(i).accept(moduleVisitor);
		}
	}
	if (exports != null) {
		for (int i = 0, n = exports.size(); i < n; i++) {
			exports.get(i).accept(moduleVisitor);
		}
	}
	if (opens != null) {
		for (int i = 0, n = opens.size(); i < n; i++) {
			opens.get(i).accept(moduleVisitor);
		}
	}
	if (uses != null) {
		for (int i = 0, n = uses.size(); i < n; i++) {
			moduleVisitor.visitUse(uses.get(i));
		}
	}
	if (provides != null) {
		for (int i = 0, n = provides.size(); i < n; i++) {
			provides.get(i).accept(moduleVisitor);
		}
	}
}
 
Example 2
Source File: ModuleNode.java    From Concurnas with MIT License 5 votes vote down vote up
/**
 * Makes the given class visitor visit this module.
 *
 * @param classVisitor a class visitor.
 */
public void accept(final ClassVisitor classVisitor) {
  ModuleVisitor moduleVisitor = classVisitor.visitModule(name, access, version);
  if (moduleVisitor == null) {
    return;
  }
  if (mainClass != null) {
    moduleVisitor.visitMainClass(mainClass);
  }
  if (packages != null) {
    for (int i = 0, n = packages.size(); i < n; i++) {
      moduleVisitor.visitPackage(packages.get(i));
    }
  }
  if (requires != null) {
    for (int i = 0, n = requires.size(); i < n; i++) {
      requires.get(i).accept(moduleVisitor);
    }
  }
  if (exports != null) {
    for (int i = 0, n = exports.size(); i < n; i++) {
      exports.get(i).accept(moduleVisitor);
    }
  }
  if (opens != null) {
    for (int i = 0, n = opens.size(); i < n; i++) {
      opens.get(i).accept(moduleVisitor);
    }
  }
  if (uses != null) {
    for (int i = 0, n = uses.size(); i < n; i++) {
      moduleVisitor.visitUse(uses.get(i));
    }
  }
  if (provides != null) {
    for (int i = 0, n = provides.size(); i < n; i++) {
      provides.get(i).accept(moduleVisitor);
    }
  }
}
 
Example 3
Source File: ModuleNode.java    From JByteMod-Beta with GNU General Public License v2.0 5 votes vote down vote up
public void accept(final ClassVisitor cv) {
  ModuleVisitor mv = cv.visitModule(name, access, version);
  if (mv == null) {
    return;
  }
  if (mainClass != null) {
    mv.visitMainClass(mainClass);
  }
  if (packages != null) {
    for (int i = 0; i < packages.size(); i++) {
      mv.visitPackage(packages.get(i));
    }
  }

  if (requires != null) {
    for (int i = 0; i < requires.size(); i++) {
      requires.get(i).accept(mv);
    }
  }
  if (exports != null) {
    for (int i = 0; i < exports.size(); i++) {
      exports.get(i).accept(mv);
    }
  }
  if (opens != null) {
    for (int i = 0; i < opens.size(); i++) {
      opens.get(i).accept(mv);
    }
  }
  if (uses != null) {
    for (int i = 0; i < uses.size(); i++) {
      mv.visitUse(uses.get(i));
    }
  }
  if (provides != null) {
    for (int i = 0; i < provides.size(); i++) {
      provides.get(i).accept(mv);
    }
  }
}
 
Example 4
Source File: ModuleNode.java    From JReFrameworker with MIT License 5 votes vote down vote up
/**
 * Makes the given class visitor visit this module.
 *
 * @param classVisitor a class visitor.
 */
public void accept(final ClassVisitor classVisitor) {
  ModuleVisitor moduleVisitor = classVisitor.visitModule(name, access, version);
  if (moduleVisitor == null) {
    return;
  }
  if (mainClass != null) {
    moduleVisitor.visitMainClass(mainClass);
  }
  if (packages != null) {
    for (int i = 0, n = packages.size(); i < n; i++) {
      moduleVisitor.visitPackage(packages.get(i));
    }
  }
  if (requires != null) {
    for (int i = 0, n = requires.size(); i < n; i++) {
      requires.get(i).accept(moduleVisitor);
    }
  }
  if (exports != null) {
    for (int i = 0, n = exports.size(); i < n; i++) {
      exports.get(i).accept(moduleVisitor);
    }
  }
  if (opens != null) {
    for (int i = 0, n = opens.size(); i < n; i++) {
      opens.get(i).accept(moduleVisitor);
    }
  }
  if (uses != null) {
    for (int i = 0, n = uses.size(); i < n; i++) {
      moduleVisitor.visitUse(uses.get(i));
    }
  }
  if (provides != null) {
    for (int i = 0, n = provides.size(); i < n; i++) {
      provides.get(i).accept(moduleVisitor);
    }
  }
}
 
Example 5
Source File: ModuleNode.java    From JReFrameworker with MIT License 5 votes vote down vote up
/**
 * Makes the given class visitor visit this module.
 *
 * @param classVisitor a class visitor.
 */
public void accept(final ClassVisitor classVisitor) {
  ModuleVisitor moduleVisitor = classVisitor.visitModule(name, access, version);
  if (moduleVisitor == null) {
    return;
  }
  if (mainClass != null) {
    moduleVisitor.visitMainClass(mainClass);
  }
  if (packages != null) {
    for (int i = 0, n = packages.size(); i < n; i++) {
      moduleVisitor.visitPackage(packages.get(i));
    }
  }
  if (requires != null) {
    for (int i = 0, n = requires.size(); i < n; i++) {
      requires.get(i).accept(moduleVisitor);
    }
  }
  if (exports != null) {
    for (int i = 0, n = exports.size(); i < n; i++) {
      exports.get(i).accept(moduleVisitor);
    }
  }
  if (opens != null) {
    for (int i = 0, n = opens.size(); i < n; i++) {
      opens.get(i).accept(moduleVisitor);
    }
  }
  if (uses != null) {
    for (int i = 0, n = uses.size(); i < n; i++) {
      moduleVisitor.visitUse(uses.get(i));
    }
  }
  if (provides != null) {
    for (int i = 0, n = provides.size(); i < n; i++) {
      provides.get(i).accept(moduleVisitor);
    }
  }
}