当前位置: 首页>>代码示例>>Java>>正文


Java PsiMethodUtil类代码示例

本文整理汇总了Java中de.plushnikov.intellij.lombok.util.PsiMethodUtil的典型用法代码示例。如果您正苦于以下问题:Java PsiMethodUtil类的具体用法?Java PsiMethodUtil怎么用?Java PsiMethodUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PsiMethodUtil类属于de.plushnikov.intellij.lombok.util包,在下文中一共展示了PsiMethodUtil类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: delegateTo

import de.plushnikov.intellij.lombok.util.PsiMethodUtil; //导入依赖的package包/类
protected <PSI extends PsiElement> void delegateTo(@NotNull PsiField psiField, @NotNull PsiAnnotation psiAnnotation, @NotNull List<PSI> target, @NotNull MethodDescriptor[] methods) {
    PsiClass psiClass = psiField.getContainingClass();
    for (MethodDescriptor methodDesc : methods) {
        PsiMethod method = PsiMethodUtil.createMethod(psiClass, methodDesc.signature, psiAnnotation);
        safeAddMethod(psiField, method, target);
    }
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:8,代码来源:AbstractGriffonLombokFieldProcessor.java

示例2: processIntern

import de.plushnikov.intellij.lombok.util.PsiMethodUtil; //导入依赖的package包/类
protected <Psi extends PsiElement> void processIntern(@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation, @NotNull List<Psi> target) {
    PsiElementFactory psiElementFactory = psiElementFactory(psiClass);
    PsiManager manager = psiClass.getContainingFile().getManager();

    PsiType psiProviderType = psiElementFactory.createTypeFromText(TWITTER4j_PROVIDER_TYPE, psiClass);
    LombokLightFieldBuilder providerField = LombokPsiElementFactory.getInstance().createLightField(manager, TWITTER4j_PROVIDER_FIELD_NAME, psiProviderType)
        .withContainingClass(psiClass)
        .withModifier(PsiModifier.PRIVATE)
        .withNavigationElement(psiAnnotation);
    PsiExpression initializer = psiElementFactory.createExpressionFromText(String.format(TWITTER4j_PROVIDER_FIELD_INITIALIZER), psiClass);
    providerField.setInitializer(initializer);

    LombokLightMethodBuilder method = LombokPsiElementFactory.getInstance().createLightMethod(psiClass.getManager(), METHOD_GET_TWITTER4j_PROVIDER)
        .withMethodReturnType(psiProviderType)
        .withContainingClass(psiClass)
        .withModifier(PsiModifier.PUBLIC)
        .withNavigationElement(psiAnnotation);
    target.add((Psi) method);

    method = LombokPsiElementFactory.getInstance().createLightMethod(psiClass.getManager(), METHOD_SET_TWITTER4j_PROVIDER)
        .withMethodReturnType(PsiPrimitiveTypeFactory.getInstance().getVoidType())
        .withContainingClass(psiClass)
        .withParameter(PROVIDER, psiProviderType)
        .withModifier(PsiModifier.PUBLIC)
        .withNavigationElement(psiAnnotation);
    target.add((Psi) method);

    for (MethodDescriptor methodDesc : METHODS) {
        target.add((Psi) PsiMethodUtil.createMethod(psiClass, methodDesc.signature, psiAnnotation));
    }
}
 
开发者ID:griffon-legacy,项目名称:griffon-twitter4j-plugin,代码行数:32,代码来源:Twitter4jAwareProcessor.java

示例3: processIntern

import de.plushnikov.intellij.lombok.util.PsiMethodUtil; //导入依赖的package包/类
protected <Psi extends PsiElement> void processIntern(@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation, @NotNull List<Psi> target) {
    PsiElementFactory psiElementFactory = psiElementFactory(psiClass);
    PsiManager manager = psiClass.getContainingFile().getManager();

    PsiType psiProviderType = psiElementFactory.createTypeFromText(JDBI_PROVIDER_TYPE, psiClass);
    LombokLightFieldBuilder providerField = LombokPsiElementFactory.getInstance().createLightField(manager, JDBI_PROVIDER_FIELD_NAME, psiProviderType)
        .withContainingClass(psiClass)
        .withModifier(PsiModifier.PRIVATE)
        .withNavigationElement(psiAnnotation);
    PsiExpression initializer = psiElementFactory.createExpressionFromText(String.format(JDBI_PROVIDER_FIELD_INITIALIZER), psiClass);
    providerField.setInitializer(initializer);

    LombokLightMethodBuilder method = LombokPsiElementFactory.getInstance().createLightMethod(psiClass.getManager(), METHOD_GET_JDBI_PROVIDER)
        .withMethodReturnType(psiProviderType)
        .withContainingClass(psiClass)
        .withModifier(PsiModifier.PUBLIC)
        .withNavigationElement(psiAnnotation);
    target.add((Psi) method);

    method = LombokPsiElementFactory.getInstance().createLightMethod(psiClass.getManager(), METHOD_SET_JDBI_PROVIDER)
        .withMethodReturnType(PsiPrimitiveTypeFactory.getInstance().getVoidType())
        .withContainingClass(psiClass)
        .withParameter(PROVIDER, psiProviderType)
        .withModifier(PsiModifier.PUBLIC)
        .withNavigationElement(psiAnnotation);
    target.add((Psi) method);

    for (MethodDescriptor methodDesc : METHODS) {
        target.add((Psi) PsiMethodUtil.createMethod(psiClass, methodDesc.signature, psiAnnotation));
    }
}
 
开发者ID:griffon-legacy,项目名称:griffon-jdbi-plugin,代码行数:32,代码来源:JdbiAwareProcessor.java

示例4: delegateTo

import de.plushnikov.intellij.lombok.util.PsiMethodUtil; //导入依赖的package包/类
protected <PSI extends PsiElement> void delegateTo(@NotNull PsiClass psiClass, @NotNull PsiAnnotation psiAnnotation, @NotNull List<PSI> target, @NotNull MethodDescriptor[] methods) {
    for (MethodDescriptor methodDesc : methods) {
        PsiMethod method = PsiMethodUtil.createMethod(psiClass, methodDesc.signature, psiAnnotation);
        safeAddMethod(psiClass, method, target);
    }
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:7,代码来源:AbstractGriffonLombokClassProcessor.java

示例5: safeAddMethod

import de.plushnikov.intellij.lombok.util.PsiMethodUtil; //导入依赖的package包/类
protected <PSI extends PsiElement> void safeAddMethod(@NotNull PsiClass psiClass, @NotNull String method, @NotNull List<PSI> target) {
    safeAddMethod(psiClass,
        PsiMethodUtil.createMethod(psiClass, method, psiClass),
        target);
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:6,代码来源:AbstractGriffonLombokClassProcessor.java

示例6: safeAddMethod

import de.plushnikov.intellij.lombok.util.PsiMethodUtil; //导入依赖的package包/类
protected <PSI extends PsiElement> void safeAddMethod(@NotNull PsiField psiField, @NotNull String method, @NotNull List<PSI> target) {
    PsiClass psiClass = psiField.getContainingClass();
    safeAddMethod(psiField,
        PsiMethodUtil.createMethod(psiClass, method, psiClass),
        target);
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:7,代码来源:AbstractGriffonLombokFieldProcessor.java


注:本文中的de.plushnikov.intellij.lombok.util.PsiMethodUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。