Search in sources :

Example 26 with PsiParameter

use of com.intellij.psi.PsiParameter in project android by JetBrains.

the class PsiCFGPartialMethodSignatureBuilder method buildFromPsiMethod.

public static PsiCFGPartialMethodSignature buildFromPsiMethod(PsiMethod psiMethod) {
    PsiCFGPartialMethodSignature retSignature = new PsiCFGPartialMethodSignature();
    retSignature.methodName = psiMethod.getName().trim();
    if (psiMethod.isVarArgs()) {
        retSignature.isVarArgs = true;
    }
    PsiParameter[] paramList = psiMethod.getParameterList().getParameters();
    if (paramList == null || paramList.length == 0) {
        retSignature.parameterTypes = PsiType.EMPTY_ARRAY;
    } else {
        retSignature.parameterTypes = new PsiType[paramList.length];
        for (int i = 0; i < paramList.length; i++) {
            PsiType curParamType = paramList[i].getType();
            retSignature.parameterTypes[i] = curParamType;
        }
    }
    return retSignature;
}
Also used : PsiParameter(com.intellij.psi.PsiParameter) PsiType(com.intellij.psi.PsiType)

Aggregations

PsiParameter (com.intellij.psi.PsiParameter)26 PsiMethod (com.intellij.psi.PsiMethod)6 PsiElement (com.intellij.psi.PsiElement)5 PsiType (com.intellij.psi.PsiType)5 ArrayList (java.util.ArrayList)5 PsiParameterList (com.intellij.psi.PsiParameterList)4 Nullable (org.jetbrains.annotations.Nullable)3 ClassMember (com.intellij.codeInsight.generation.ClassMember)2 TextRange (com.intellij.openapi.util.TextRange)2 PsiField (com.intellij.psi.PsiField)2 PsiPrimitiveType (com.intellij.psi.PsiPrimitiveType)2 PsiVariable (com.intellij.psi.PsiVariable)2 IncorrectOperationException (com.intellij.util.IncorrectOperationException)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (com.android.annotations.Nullable)1 ResourceUrl (com.android.ide.common.resources.ResourceUrl)1 ResourceType (com.android.resources.ResourceType)1 Location (com.android.tools.klint.detector.api.Location)1 JavaEvaluator (com.android.tools.lint.client.api.JavaEvaluator)1 AddAnnotationPsiFix (com.intellij.codeInsight.intention.AddAnnotationPsiFix)1