Search in sources :

Example 1 with PsiEllipsisType

use of com.intellij.psi.PsiEllipsisType in project intellij-community by JetBrains.

the class StreamingJsonBuilderDelegateContributor method processDynamicMethods.

@Override
boolean processDynamicMethods(@NotNull PsiType qualifierType, @NotNull PsiClass clazz, @NotNull String name, @NotNull PsiElement place, @NotNull Processor<PsiElement> processor) {
    GrLightMethodBuilder method;
    // (Object...)
    method = createMethod(name, place, clazz);
    method.addParameter("values", new PsiEllipsisType(TypeUtils.getObjectType(place)));
    if (!processor.process(method))
        return false;
    // (Closure)
    method = createMethod(name, place, clazz);
    addClosureParameter(method);
    if (!processor.process(method))
        return false;
    // (Iterable, Closure)
    method = createMethod(name, place, clazz);
    method.addParameter("values", TypesUtil.createIterableType(place, null));
    addClosureParameter(method);
    if (!processor.process(method))
        return false;
    // (Object[], Closure)
    method = createMethod(name, place, clazz);
    method.addParameter("values", TypesUtil.getJavaLangObject(place).createArrayType());
    addClosureParameter(method);
    if (!processor.process(method))
        return false;
    // (Object, Closure)
    method = createMethod(name, place, clazz);
    method.addParameter("value", TypesUtil.getJavaLangObject(place));
    addClosureParameter(method);
    return processor.process(method);
}
Also used : PsiEllipsisType(com.intellij.psi.PsiEllipsisType) GrLightMethodBuilder(org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrLightMethodBuilder)

Aggregations

PsiEllipsisType (com.intellij.psi.PsiEllipsisType)1 GrLightMethodBuilder (org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrLightMethodBuilder)1