Java 类com.intellij.psi.impl.light.LightFieldBuilder 实例源码

项目:intellij-ce-playground    文件:GrCollectionTypeMembersProvider.java   
@Override
public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) {
  if (element instanceof PsiField) {
    final PsiType type = ((PsiField)element).getType();
    final String typeText = type instanceof PsiClassType ? CommonClassNames.JAVA_UTIL_COLLECTION + "<" + type.getCanonicalText() + ">"
                                                         : CommonClassNames.JAVA_UTIL_COLLECTION;
    LightFieldBuilder lightField = new LightFieldBuilder(((PsiField)element).getName(), typeText, element);
    lightField.setContainingClass(myCollectionClass);
    lightField.setOriginInfo("spread collection field");
    return super.execute(lightField, state);
  }
  return true;
}
项目:tools-idea    文件:GrCollectionTypeMembersProvider.java   
@Override
public boolean execute(@NotNull PsiElement element, ResolveState state) {
  if (element instanceof PsiField) {
    final PsiType type = ((PsiField)element).getType();
    final String typeText =
      type instanceof PsiClassType ? JAVA_UTIL_COLLECTION + "<" + type.getCanonicalText() + ">" : JAVA_UTIL_COLLECTION;
    LightFieldBuilder lightField = new LightFieldBuilder(((PsiField)element).getName(), typeText, element);
    lightField.setContainingClass(myCollectionClass);
    lightField.setOriginInfo("spread collection field");
    return super.execute(lightField, state);
  }
  return true;
}
项目:consulo-ikvm    文件:JavaFieldStubBuilder.java   
@NotNull
@Override
public PsiField buildToPsi(@Nullable PsiElement parent)
{
    LightFieldBuilder builder = new LightFieldBuilder(normalize(myName), normalizeType(myType), myNavTarget);
    builder.setModifiers(ArrayUtil.toStringArray(myModifiers));
    builder.setContainingClass((PsiClass) parent);
    return builder;
}
项目:lombok-intellij-plugin    文件:LombokLightClassBuilder.java   
public LightPsiClassBuilder addField(PsiField field) {
  if (field instanceof LightFieldBuilder) {
    ((LightFieldBuilder) field).setContainingClass(this);
  }
  myFields.add(field);
  return this;
}
项目:consulo-javaee    文件:JspClassImpl.java   
private void addField(List<PsiField> fields, String name, String type)
{
    PsiClassType classType = JavaPsiFacade.getElementFactory(getProject()).createTypeByFQClassName(type, getResolveScope());

    LightFieldBuilder builder = new LightFieldBuilder(getManager(), name, classType);
    builder.setModifiers(PsiModifier.PRIVATE, PsiModifier.FINAL);
    builder.setContainingClass(this);
    fields.add(builder);
}