当前位置: 首页>>代码示例>>Java>>正文


Java ImplicitUsageProvider.isImplicitWrite方法代码示例

本文整理汇总了Java中com.intellij.codeInsight.daemon.ImplicitUsageProvider.isImplicitWrite方法的典型用法代码示例。如果您正苦于以下问题:Java ImplicitUsageProvider.isImplicitWrite方法的具体用法?Java ImplicitUsageProvider.isImplicitWrite怎么用?Java ImplicitUsageProvider.isImplicitWrite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.codeInsight.daemon.ImplicitUsageProvider的用法示例。


在下文中一共展示了ImplicitUsageProvider.isImplicitWrite方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAllOriginalMembers

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
protected ClassMember[] getAllOriginalMembers(PsiClass aClass) {
  PsiField[] fields = aClass.getFields();
  ArrayList<ClassMember> array = new ArrayList<ClassMember>();
  ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
  fieldLoop: for (PsiField field : fields) {
    if (field.hasModifierProperty(PsiModifier.STATIC)) continue;

    if (field.hasModifierProperty(PsiModifier.FINAL) && field.getInitializer() != null) continue;

    for(ImplicitUsageProvider provider: implicitUsageProviders) {
      if (provider.isImplicitWrite(field)) continue fieldLoop;
    }
    array.add(new PsiFieldMember(field));
  }
  return array.toArray(new ClassMember[array.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:GenerateConstructorHandler.java

示例2: getAllOriginalMembers

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
protected ClassMember[] getAllOriginalMembers(PsiClass aClass) {
  PsiField[] fields = aClass.getFields();
  ArrayList<ClassMember> array = new ArrayList<ClassMember>();
  ImplicitUsageProvider[] implicitUsageProviders = Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
  fieldLoop:
  for (PsiField field : fields) {
    if (field.hasModifierProperty(PsiModifier.STATIC)) {
      continue;
    }

    if (field.hasModifierProperty(PsiModifier.FINAL) && field.getInitializer() != null) {
      continue;
    }

    for (ImplicitUsageProvider provider : implicitUsageProviders) {
      if (!(provider instanceof LombokImplicitUsageProvider) && provider.isImplicitWrite(field)) {
        continue fieldLoop;
      }
    }
    array.add(new PsiFieldMember(field));
  }
  return array.toArray(new ClassMember[array.size()]);
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:25,代码来源:LombokGenerateConstructorHandler.java

示例3: hasImplicitReadOrWriteUsage

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
private static boolean hasImplicitReadOrWriteUsage(final PsiField field, ImplicitUsageProvider[] implicitUsageProviders) {
  for (ImplicitUsageProvider provider : implicitUsageProviders) {
    if (provider.isImplicitRead(field) || provider.isImplicitWrite(field)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:FieldCanBeLocalInspectionBase.java

示例4: isImplicitWrite

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public static boolean isImplicitWrite(@NotNull Project project,
                                      @NotNull PsiVariable element,
                                      @NotNull ProgressIndicator progress) {
  for(ImplicitUsageProvider provider: ourImplicitUsageProviders) {
    progress.checkCanceled();
    if (provider.isImplicitWrite(element)) {
      return true;
    }
  }
  return isInjected(project, element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:UnusedSymbolUtil.java

示例5: isInitializedImplicitly

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
private static boolean isInitializedImplicitly(PsiField field) {
  field = CompletionUtil.getOriginalOrSelf(field);
  for(ImplicitUsageProvider provider: ImplicitUsageProvider.EP_NAME.getExtensions()) {
    if (provider.isImplicitWrite(field)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:JavaCompletionProcessor.java

示例6: isImplicitWrite

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
private static boolean isImplicitWrite(final PsiVariable element, ProgressIndicator progress) {
  for(ImplicitUsageProvider provider: ourImplicitUsageProviders) {
    progress.checkCanceled();
    if (provider.isImplicitWrite(element)) {
      return true;
    }
  }
  return UnusedSymbolLocalInspection.isInjected(element);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:PostHighlightingPass.java

示例7: isImplicitWrite

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
public static boolean isImplicitWrite(@NotNull Project project,
		@NotNull PsiVariable element,
		@NotNull ProgressIndicator progress)
{
	for(ImplicitUsageProvider provider : ourImplicitUsageProviders)
	{
		progress.checkCanceled();
		if(provider.isImplicitWrite(element))
		{
			return true;
		}
	}
	return isInjected(project, element);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:UnusedSymbolUtil.java

示例8: isInitializedImplicitly

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
private static boolean isInitializedImplicitly(PsiField field)
{
	field = CompletionUtil.getOriginalOrSelf(field);
	for(ImplicitUsageProvider provider : ImplicitUsageProvider.EP_NAME.getExtensions())
	{
		if(provider.isImplicitWrite(field))
		{
			return true;
		}
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:13,代码来源:CheckInitialized.java

示例9: visitField

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
public void visitField(@NotNull PsiField field) {
  if (field.hasModifierProperty(PsiModifier.STATIC) ||
      field.hasModifierProperty(PsiModifier.FINAL)) {
    return;
  }
  if (field.getInitializer() != null) {
    return;
  }
  if (m_ignorePrimitives) {
    final PsiType fieldType = field.getType();
    if (ClassUtils.isPrimitive(fieldType)) {
      return;
    }
  }
  final PsiClass aClass = field.getContainingClass();
  if (aClass == null) {
    return;
  }
  final ImplicitUsageProvider[] implicitUsageProviders =
    Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
  for (ImplicitUsageProvider provider : implicitUsageProviders) {
    if (provider.isImplicitWrite(field)) {
      return;
    }
  }
  final boolean isTestClass = TestUtils.isJUnitTestClass(aClass);
  if (isTestClass) {
    if (isInitializedInSetup(field, aClass)) {
      return;
    }
  }
  if (isInitializedInInitializer(field)) {
    return;
  }
  if (isInitializedInConstructors(field, aClass)) {
    return;
  }
  if (isTestClass) {
    registerFieldError(field, Boolean.TRUE);
  }
  else {
    registerFieldError(field, Boolean.FALSE);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:46,代码来源:InstanceVariableInitializationInspection.java

示例10: visitField

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
public void visitField(@NotNull PsiField field) {
  if (field.hasModifierProperty(PsiModifier.STATIC) || field.hasModifierProperty(PsiModifier.FINAL)) {
    return;
  }
  if (field.getInitializer() != null) {
    return;
  }
  final PsiAnnotation annotation = AnnotationUtil.findAnnotation(field, annotationNames);
  if (annotation != null) {
    return;
  }
  if (m_ignorePrimitives) {
    final PsiType fieldType = field.getType();
    if (ClassUtils.isPrimitive(fieldType)) {
      return;
    }
  }
  final PsiClass aClass = field.getContainingClass();
  if (aClass == null) {
    return;
  }
  for (ImplicitUsageProvider provider :
    Extensions.getExtensions(ImplicitUsageProvider.EP_NAME)) {
    if (provider.isImplicitWrite(field)) {
      return;
    }
  }
  final UninitializedReadCollector uninitializedReadsCollector = new UninitializedReadCollector();
  if (!isInitializedInInitializer(field, uninitializedReadsCollector)) {
    final PsiMethod[] constructors = aClass.getConstructors();
    for (final PsiMethod constructor : constructors) {
      final PsiCodeBlock body = constructor.getBody();
      uninitializedReadsCollector.blockAssignsVariable(body, field);
    }
  }
  final PsiExpression[] badReads = uninitializedReadsCollector.getUninitializedReads();
  for (PsiExpression expression : badReads) {
    registerError(expression, field);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:InstanceVariableUninitializedUseInspectionBase.java

示例11: visitField

import com.intellij.codeInsight.daemon.ImplicitUsageProvider; //导入方法依赖的package包/类
@Override
public void visitField(@NotNull PsiField field) {
  if (field.hasModifierProperty(PsiModifier.STATIC)) {
    return;
  }
  if (field.getInitializer() != null) {
    return;
  }
  final PsiAnnotation annotation = AnnotationUtil.findAnnotation(field, annotationNames);
  if (annotation != null) {
    return;
  }
  if (m_ignorePrimitives) {
    final PsiType fieldType = field.getType();
    if (ClassUtils.isPrimitive(fieldType)) {
      return;
    }
  }
  final PsiClass aClass = field.getContainingClass();
  if (aClass == null) {
    return;
  }
  for (ImplicitUsageProvider provider :
    Extensions.getExtensions(ImplicitUsageProvider.EP_NAME)) {
    if (provider.isImplicitWrite(field)) {
      return;
    }
  }
  final UninitializedReadCollector uninitializedReadsCollector = new UninitializedReadCollector();
  if (!isInitializedInInitializer(field, uninitializedReadsCollector)) {
    final PsiMethod[] constructors = aClass.getConstructors();
    for (final PsiMethod constructor : constructors) {
      final PsiCodeBlock body = constructor.getBody();
      uninitializedReadsCollector.blockAssignsVariable(body, field);
    }
  }
  final PsiExpression[] badReads = uninitializedReadsCollector.getUninitializedReads();
  for (PsiExpression expression : badReads) {
    registerError(expression, field);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:42,代码来源:InstanceVariableUninitializedUseInspection.java


注:本文中的com.intellij.codeInsight.daemon.ImplicitUsageProvider.isImplicitWrite方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。