當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。