本文整理匯總了Java中com.siyeh.ig.dependency.DependencyUtils類的典型用法代碼示例。如果您正苦於以下問題:Java DependencyUtils類的具體用法?Java DependencyUtils怎麽用?Java DependencyUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DependencyUtils類屬於com.siyeh.ig.dependency包,在下文中一共展示了DependencyUtils類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRelatedClasses
import com.siyeh.ig.dependency.DependencyUtils; //導入依賴的package包/類
private static Set<RefClass> getRelatedClasses(RefPackage aPackage,
RefClass classToProcess) {
final Set<RefClass> out = new HashSet<RefClass>();
final Set<RefClass> dependencies =
DependencyUtils.calculateDependenciesForClass(classToProcess);
for (RefClass dependency : dependencies) {
if (packageContainsClass(aPackage, dependency)) {
out.add(dependency);
}
}
final Set<RefClass> dependents =
DependencyUtils.calculateDependentsForClass(classToProcess);
for (RefClass dependent : dependents) {
if (packageContainsClass(aPackage, dependent)) {
out.add(dependent);
}
}
return out;
}
示例2: checkElement
import com.siyeh.ig.dependency.DependencyUtils; //導入依賴的package包/類
@Nullable
@Override
public CommonProblemDescriptor[] checkElement(
@NotNull RefEntity refEntity,
@NotNull AnalysisScope scope,
@NotNull InspectionManager manager,
@NotNull GlobalInspectionContext globalContext) {
if (!(refEntity instanceof RefClass)) {
return null;
}
final RefClass refClass = (RefClass)refEntity;
final RefEntity owner = refClass.getOwner();
if (!(owner instanceof RefPackage)) {
return null;
}
final Set<RefClass> dependencies =
DependencyUtils.calculateDependenciesForClass(refClass);
for (RefClass dependency : dependencies) {
if (inSameModule(refClass, dependency)) {
return null;
}
}
final Set<RefClass> dependents =
DependencyUtils.calculateDependentsForClass(refClass);
for (RefClass dependent : dependents) {
if (inSameModule(refClass, dependent)) {
return null;
}
}
final PsiClass aClass = refClass.getElement();
final PsiIdentifier identifier = aClass.getNameIdentifier();
if (identifier == null) {
return null;
}
return new CommonProblemDescriptor[]{
manager.createProblemDescriptor(identifier,
InspectionGadgetsBundle.message(
"class.independent.of.module.problem.descriptor"),
true, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false)
};
}
示例3: checkElement
import com.siyeh.ig.dependency.DependencyUtils; //導入依賴的package包/類
@Override
@Nullable
public CommonProblemDescriptor[] checkElement(
@NotNull RefEntity refEntity,
@NotNull AnalysisScope analysisScope,
@NotNull InspectionManager manager,
@NotNull GlobalInspectionContext globalInspectionContext) {
if (!(refEntity instanceof RefClass)) {
return null;
}
final RefClass refClass = (RefClass)refEntity;
final RefEntity owner = refClass.getOwner();
if (!(owner instanceof RefPackage)) {
return null;
}
final Set<RefClass> dependencies =
DependencyUtils.calculateDependenciesForClass(refClass);
for (RefClass dependency : dependencies) {
if (inSamePackage(refClass, dependency)) {
return null;
}
}
final Set<RefClass> dependents =
DependencyUtils.calculateDependentsForClass(refClass);
for (RefClass dependent : dependents) {
if (inSamePackage(refClass, dependent)) {
return null;
}
}
final PsiClass aClass = refClass.getElement();
final PsiIdentifier identifier = aClass.getNameIdentifier();
if (identifier == null) {
return null;
}
return new CommonProblemDescriptor[]{
manager.createProblemDescriptor(identifier,
InspectionGadgetsBundle.message(
"class.unconnected.to.package.problem.descriptor"),
true, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false)
};
}
示例4: checkElement
import com.siyeh.ig.dependency.DependencyUtils; //導入依賴的package包/類
@Nullable
@Override
public CommonProblemDescriptor[] checkElement(
RefEntity refEntity,
AnalysisScope scope,
InspectionManager manager,
GlobalInspectionContext globalContext) {
if (!(refEntity instanceof RefClass)) {
return null;
}
final RefClass refClass = (RefClass)refEntity;
final RefEntity owner = refClass.getOwner();
if (!(owner instanceof RefPackage)) {
return null;
}
final Set<RefClass> dependencies =
DependencyUtils.calculateDependenciesForClass(refClass);
for (RefClass dependency : dependencies) {
if (inSameModule(refClass, dependency)) {
return null;
}
}
final Set<RefClass> dependents =
DependencyUtils.calculateDependentsForClass(refClass);
for (RefClass dependent : dependents) {
if (inSameModule(refClass, dependent)) {
return null;
}
}
final PsiClass aClass = refClass.getElement();
final PsiIdentifier identifier = aClass.getNameIdentifier();
if (identifier == null) {
return null;
}
return new CommonProblemDescriptor[]{
manager.createProblemDescriptor(identifier,
InspectionGadgetsBundle.message(
"class.independent.of.module.problem.descriptor"),
true, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false)
};
}
示例5: checkElement
import com.siyeh.ig.dependency.DependencyUtils; //導入依賴的package包/類
@Override
@Nullable
public CommonProblemDescriptor[] checkElement(
RefEntity refEntity,
AnalysisScope analysisScope,
InspectionManager manager,
GlobalInspectionContext globalInspectionContext) {
if (!(refEntity instanceof RefClass)) {
return null;
}
final RefClass refClass = (RefClass)refEntity;
final RefEntity owner = refClass.getOwner();
if (!(owner instanceof RefPackage)) {
return null;
}
final Set<RefClass> dependencies =
DependencyUtils.calculateDependenciesForClass(refClass);
for (RefClass dependency : dependencies) {
if (inSamePackage(refClass, dependency)) {
return null;
}
}
final Set<RefClass> dependents =
DependencyUtils.calculateDependentsForClass(refClass);
for (RefClass dependent : dependents) {
if (inSamePackage(refClass, dependent)) {
return null;
}
}
final PsiClass aClass = refClass.getElement();
final PsiIdentifier identifier = aClass.getNameIdentifier();
if (identifier == null) {
return null;
}
return new CommonProblemDescriptor[]{
manager.createProblemDescriptor(identifier,
InspectionGadgetsBundle.message(
"class.unconnected.to.package.problem.descriptor"),
true, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false)
};
}