Java 类com.intellij.psi.impl.java.stubs.PsiModifierListStub 实例源码

项目:intellij-ce-playground    文件:TypeInfo.java   
@NotNull
public TypeInfo applyAnnotations(@NotNull StubBase<?> owner) {
  PsiModifierListStub modifierList = (PsiModifierListStub)owner.findChildStubByType(JavaStubElementTypes.MODIFIER_LIST);
  if (modifierList == null) return this;

  List<PsiAnnotationStub> annotationStubs = null;
  for (StubElement child : modifierList.getChildrenStubs()) {
    if (!(child instanceof PsiAnnotationStub)) continue;
    PsiAnnotationStub annotationStub = (PsiAnnotationStub)child;
    if (PsiImplUtil.isTypeAnnotation(annotationStub.getPsiElement())) {
      if (annotationStubs == null) annotationStubs = new SmartList<PsiAnnotationStub>();
      annotationStubs.add(annotationStub);
    }
  }

  PsiAnnotationStub[] stubArray = PsiAnnotationStub.EMPTY_ARRAY;
  if (annotationStubs != null) stubArray = annotationStubs.toArray(new PsiAnnotationStub[annotationStubs.size()]);
  return new TypeInfo(text, arrayCount, isEllipsis, stubArray);
}
项目:consulo-java    文件:StubBuildingVisitor.java   
@Override
@Nullable
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value)
{
    if(isSet(access, Opcodes.ACC_SYNTHETIC))
    {
        return null;
    }
    if(name == null)
    {
        return null;
    }

    byte flags = PsiFieldStubImpl.packFlags(isSet(access, Opcodes.ACC_ENUM), isSet(access, Opcodes.ACC_DEPRECATED), false, false);
    TypeInfo type = fieldType(desc, signature);
    String initializer = constToString(value, type.text, false, myMapping);
    PsiFieldStub stub = new PsiFieldStubImpl(myResult, name, type, initializer, flags);
    PsiModifierListStub modList = new PsiModifierListStubImpl(stub, packFieldFlags(access));
    return new FieldAnnotationCollectingVisitor(modList, myMapping);
}
项目:consulo-java    文件:StubBuildingVisitor.java   
private MethodAnnotationCollectingVisitor(PsiMethodStub owner,
        PsiModifierListStub modList,
        int ignoreCount,
        int paramIgnoreCount,
        int paramCount,
        PsiParameterStubImpl[] paramStubs,
        Function<String, String> mapping)
{
    super(ASM_API);
    myOwner = owner;
    myModList = modList;
    myIgnoreCount = ignoreCount;
    myParamIgnoreCount = paramIgnoreCount;
    myParamCount = paramCount;
    myParamStubs = paramStubs;
    myMapping = mapping;
}
项目:consulo-java    文件:RecordUtil.java   
public static boolean isStaticNonPrivateMember(@NotNull StubElement<?> stub)
{
    StubElement<PsiModifierList> type = stub.findChildStubByType(JavaStubElementTypes.MODIFIER_LIST);
    if(!(type instanceof PsiModifierListStub))
    {
        return false;
    }

    int mask = ((PsiModifierListStub) type).getModifiersMask();
    if(ModifierFlags.hasModifierProperty(PsiModifier.PRIVATE, mask))
    {
        return false;
    }

    if(ModifierFlags.hasModifierProperty(PsiModifier.STATIC, mask))
    {
        return true;
    }

    return stub instanceof PsiFieldStub && stub.getStubType() == JavaElementType.ENUM_CONSTANT || stub.getParentStub() instanceof PsiClassStub && ((PsiClassStub) stub.getParentStub()).isInterface();
}
项目:consulo-java    文件:PsiModifierListImpl.java   
private Set<String> calcExplicitModifiers()
{
    Set<String> explicitModifiers = ContainerUtil.newHashSet();
    PsiModifierListStub stub = getGreenStub();
    if(stub != null)
    {
        int mask = stub.getModifiersMask();
        for(int i = 0; i < 31; i++)
        {
            int flag = 1 << i;
            if(BitUtil.isSet(mask, flag))
            {
                ContainerUtil.addIfNotNull(explicitModifiers, ModifierFlags.MODIFIER_FLAG_TO_NAME_MAP.get(flag));
            }
        }
    }
    else
    {
        for(ASTNode child : getNode().getChildren(null))
        {
            ContainerUtil.addIfNotNull(explicitModifiers, KEYWORD_TYPE_TO_NAME_MAP.get(child.getElementType()));
        }
    }

    return explicitModifiers;
}
项目:intellij-ce-playground    文件:PsiParameterStubImpl.java   
@Override
public PsiModifierListStub getModList() {
  for (StubElement child : getChildrenStubs()) {
    if (child instanceof PsiModifierListStub) {
      return (PsiModifierListStub)child;
    }
  }
  return null;
}
项目:tools-idea    文件:PsiParameterStubImpl.java   
@Override
public PsiModifierListStub getModList() {
  for (StubElement child : getChildrenStubs()) {
    if (child instanceof PsiModifierListStub) {
      return (PsiModifierListStub)child;
    }
  }
  return null;
}
项目:tools-idea    文件:TypeInfo.java   
@NotNull
public TypeInfo applyAnnotations(@NotNull StubBase<?> owner) {
  PsiModifierListStub modifierList = (PsiModifierListStub)owner.findChildStubByType(JavaStubElementTypes.MODIFIER_LIST);
  if (modifierList == null) return this;

  List<PsiAnnotationStub> annotationStubs = ContainerUtil.newArrayList();
  for (StubElement child : modifierList.getChildrenStubs()) {
    if (!(child instanceof PsiAnnotationStub)) continue;
    PsiAnnotationStub annotationStub = (PsiAnnotationStub)child;
    if (PsiImplUtil.findApplicableTarget(annotationStub.getPsiElement(), TargetType.TYPE_USE) == TargetType.TYPE_USE) {
      annotationStubs.add(annotationStub);
    }
  }
  return new TypeInfo(text, arrayCount, isEllipsis, annotationStubs);
}
项目:consulo-java    文件:PsiParameterStubImpl.java   
@Override
public PsiModifierListStub getModList()
{
    for(StubElement child : getChildrenStubs())
    {
        if(child instanceof PsiModifierListStub)
        {
            return (PsiModifierListStub) child;
        }
    }
    return null;
}
项目:consulo-java    文件:TypeInfo.java   
@NotNull
public TypeInfo applyAnnotations(@NotNull StubBase<?> owner)
{
    PsiModifierListStub modifierList = (PsiModifierListStub) owner.findChildStubByType(JavaStubElementTypes.MODIFIER_LIST);
    if(modifierList == null)
    {
        return this;
    }

    List<PsiAnnotationStub> annotationStubs = null;
    for(StubElement child : modifierList.getChildrenStubs())
    {
        if(!(child instanceof PsiAnnotationStub))
        {
            continue;
        }
        PsiAnnotationStub annotationStub = (PsiAnnotationStub) child;
        if(PsiImplUtil.isTypeAnnotation(annotationStub.getPsiElement()))
        {
            if(annotationStubs == null)
            {
                annotationStubs = new SmartList<PsiAnnotationStub>();
            }
            annotationStubs.add(annotationStub);
        }
    }

    PsiAnnotationStub[] stubArray = PsiAnnotationStub.EMPTY_ARRAY;
    if(annotationStubs != null)
    {
        stubArray = annotationStubs.toArray(new PsiAnnotationStub[annotationStubs.size()]);
    }
    return new TypeInfo(text, arrayCount, isEllipsis, stubArray);
}
项目:consulo-java    文件:PsiModifierListImpl.java   
@Override
public boolean hasExplicitModifier(@NotNull String name)
{
    PsiModifierListStub stub = getGreenStub();
    if(stub != null)
    {
        return BitUtil.isSet(stub.getModifiersMask(), ModifierFlags.NAME_TO_MODIFIER_FLAG_MAP.get(name));
    }

    final CompositeElement tree = (CompositeElement) getNode();
    final IElementType type = NAME_TO_KEYWORD_TYPE_MAP.get(name);
    return tree.findChildByType(type) != null;
}
项目:intellij-ce-playground    文件:ClsModifierListImpl.java   
public ClsModifierListImpl(final PsiModifierListStub stub) {
  super(stub);
}
项目:intellij-ce-playground    文件:PsiModifierListImpl.java   
public PsiModifierListImpl(final PsiModifierListStub stub) {
  super(stub, JavaStubElementTypes.MODIFIER_LIST);
}
项目:tools-idea    文件:ClsModifierListImpl.java   
public ClsModifierListImpl(final PsiModifierListStub stub) {
  super(stub);
}
项目:tools-idea    文件:PsiModifierListImpl.java   
public PsiModifierListImpl(final PsiModifierListStub stub) {
  super(stub, JavaStubElementTypes.MODIFIER_LIST);
}
项目:consulo-java    文件:ClsModifierListImpl.java   
public ClsModifierListImpl(PsiModifierListStub stub)
{
    super(stub);
}
项目:consulo-java    文件:StubBuildingVisitor.java   
private FieldAnnotationCollectingVisitor(PsiModifierListStub modList, Function<String, String> mapping)
{
    super(ASM_API);
    myModList = modList;
    myMapping = mapping;
}
项目:consulo-java    文件:PsiModifierListImpl.java   
public PsiModifierListImpl(final PsiModifierListStub stub)
{
    super(stub, JavaStubElementTypes.MODIFIER_LIST);
}