public ClsParameterImpl(@NotNull PsiParameterStub stub) { super(stub); myType = new AtomicNotNullLazyValue<PsiTypeElement>() { @NotNull @Override protected PsiTypeElement compute() { PsiParameterStub stub = getStub(); String typeText = TypeInfo.createTypeText(stub.getType(false)); assert typeText != null : stub; return new ClsTypeElementImpl(ClsParameterImpl.this, typeText, ClsTypeElementImpl.VARIANCE_NONE); } }; }
public boolean isAutoGeneratedName() { final List children = getParentStub().getChildrenStubs(); int paramIndex = 0; for (Object o : children) { if (o instanceof PsiParameterStub) { paramIndex++; if (o == this) break; } } return ("p" + paramIndex).equals(getName()); }
@Override @NotNull public final String getName() { PsiParameterStub stub = getStub(); if (stub != null) { return stub.getName(); } return getNameIdentifier().getText(); }
@Override public boolean isVarArgs() { final PsiParameterStub stub = getStub(); if (stub != null) { return stub.isParameterTypeEllipsis(); } myCachedType = null; final PsiTypeElement typeElement = getTypeElement(); return typeElement != null && SourceTreeToPsiMap.psiToTreeNotNull(typeElement).findChildByType(JavaTokenType.ELLIPSIS) != null; }
@Override @NotNull public final String getName() { PsiParameterStub stub = getStub(); if (stub != null) { return stub.getName(); } return getParameterIdentifier().getText(); }
@Override @NotNull public final String getName() { PsiParameterStub stub = getStub(); if(stub != null) { return stub.getName(); } return getNameIdentifier().getText(); }
@Override public boolean isVarArgs() { final PsiParameterStub stub = getStub(); if(stub != null) { return stub.isParameterTypeEllipsis(); } myCachedType = null; final PsiTypeElement typeElement = getTypeElement(); return typeElement != null && SourceTreeToPsiMap.psiToTreeNotNull(typeElement).findChildByType(JavaTokenType .ELLIPSIS) != null; }
private int getIndex() { final PsiParameterStub stub = getStub(); return stub.getParentStub().getChildrenStubs().indexOf(stub); }
public PsiParameterImpl(@NotNull PsiParameterStub stub) { this(stub, JavaStubElementTypes.PARAMETER); }
protected PsiParameterImpl(@NotNull PsiParameterStub stub, @NotNull IStubElementType type) { super(stub, type); }
public PsiReceiverParameterImpl(@NotNull PsiParameterStub stub) { super(stub, JavaStubElementTypes.RECEIVER_PARAMETER); }