本文整理匯總了Java中org.eclipse.jdt.core.compiler.IProblem.CannotImportPackage方法的典型用法代碼示例。如果您正苦於以下問題:Java IProblem.CannotImportPackage方法的具體用法?Java IProblem.CannotImportPackage怎麽用?Java IProblem.CannotImportPackage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.core.compiler.IProblem
的用法示例。
在下文中一共展示了IProblem.CannotImportPackage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isUnusedImport
import org.eclipse.jdt.core.compiler.IProblem; //導入方法依賴的package包/類
public static boolean isUnusedImport(IProblemLocation problem) {
int id = problem.getProblemId();
return id == IProblem.UnusedImport
|| id == IProblem.DuplicateImport
|| id == IProblem.ConflictingImport
|| id == IProblem.CannotImportPackage
|| id == IProblem.ImportNotFound;
}
示例2: computeNumberOfFixes
import org.eclipse.jdt.core.compiler.IProblem; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public int computeNumberOfFixes(CompilationUnit compilationUnit) {
int result = 0;
IProblem[] problems = compilationUnit.getProblems();
if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_IMPORTS)
&& !isEnabled(CleanUpConstants.ORGANIZE_IMPORTS)) {
for (int i = 0; i < problems.length; i++) {
int id = problems[i].getID();
if (id == IProblem.UnusedImport
|| id == IProblem.DuplicateImport
|| id == IProblem.ConflictingImport
|| id == IProblem.CannotImportPackage
|| id == IProblem.ImportNotFound) result++;
}
}
if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS)
&& isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_METHODS))
result += getNumberOfProblems(problems, IProblem.UnusedPrivateMethod);
if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS)
&& isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_CONSTRUCTORS))
result += getNumberOfProblems(problems, IProblem.UnusedPrivateConstructor);
if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS)
&& isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_TYPES))
result += getNumberOfProblems(problems, IProblem.UnusedPrivateType);
if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS)
&& isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_FELDS))
result += getNumberOfProblems(problems, IProblem.UnusedPrivateField);
if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_LOCAL_VARIABLES))
result += getNumberOfProblems(problems, IProblem.LocalVariableIsNeverUsed);
return result;
}
示例3: isUnusedImport
import org.eclipse.jdt.core.compiler.IProblem; //導入方法依賴的package包/類
public static boolean isUnusedImport(IProblemLocation problem) {
int id= problem.getProblemId();
return id == IProblem.UnusedImport || id == IProblem.DuplicateImport || id == IProblem.ConflictingImport || id == IProblem.CannotImportPackage || id == IProblem.ImportNotFound;
}