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


Java PhpLangUtil.equalsClassNames方法代码示例

本文整理汇总了Java中com.jetbrains.php.lang.PhpLangUtil.equalsClassNames方法的典型用法代码示例。如果您正苦于以下问题:Java PhpLangUtil.equalsClassNames方法的具体用法?Java PhpLangUtil.equalsClassNames怎么用?Java PhpLangUtil.equalsClassNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jetbrains.php.lang.PhpLangUtil的用法示例。


在下文中一共展示了PhpLangUtil.equalsClassNames方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPropertyValueCompletions

import com.jetbrains.php.lang.PhpLangUtil; //导入方法依赖的package包/类
@Override
public void getPropertyValueCompletions(AnnotationPropertyParameter annotationPropertyParameter, AnnotationCompletionProviderParameter completionParameter) {

    String propertyName = annotationPropertyParameter.getPropertyName();
    if(propertyName == null) {
        return;
    }

    if(propertyName.equals("type") && PhpLangUtil.equalsClassNames(annotationPropertyParameter.getPhpClass().getPresentableFQN(), "Doctrine\\ORM\\Mapping\\Column")) {
        completionParameter.getResult().addAllElements(DoctrineUtil.getTypes(annotationPropertyParameter.getProject()));
    }

    if(propertyName.equals("onDelete") && PhpLangUtil.equalsClassNames(annotationPropertyParameter.getPhpClass().getPresentableFQN(), "Doctrine\\ORM\\Mapping\\JoinColumn")) {
        for(String s: Arrays.asList("CASCADE", "SET NULL")) {
            completionParameter.getResult().addElement(LookupElementBuilder.create(s));
        }
    }

}
 
开发者ID:Haehnchen,项目名称:idea-php-annotation-plugin,代码行数:20,代码来源:DoctrineAnnotationStaticCompletionProvider.java

示例2: getPropertyValueCompletions

import com.jetbrains.php.lang.PhpLangUtil; //导入方法依赖的package包/类
@Override
public void getPropertyValueCompletions(AnnotationPropertyParameter annotationPropertyParameter, AnnotationCompletionProviderParameter completionParameter) {

    String propertyName = annotationPropertyParameter.getPropertyName();
    if(propertyName == null) {
        return;
    }

    if(propertyName.equals("name") && PhpLangUtil.equalsClassNames(annotationPropertyParameter.getPhpClass().getPresentableFQN(), "Doctrine\\ORM\\Mapping\\Column")) {
        PhpDocComment phpDocComment = PsiTreeUtil.getParentOfType(annotationPropertyParameter.getElement(), PhpDocComment.class);
        if(phpDocComment != null) {
            PhpPsiElement classField = phpDocComment.getNextPsiSibling();
            if(classField != null && classField.getNode().getElementType() == PhpElementTypes.CLASS_FIELDS) {
                Field field = PsiTreeUtil.getChildOfType(classField, Field.class);
                if(field != null) {
                    String name = field.getName();
                    if(StringUtils.isNotBlank(name)) {
                        completionParameter.getResult().addElement(LookupElementBuilder.create(underscore(name)));
                    }
                }
            }
        }
    }

}
 
开发者ID:Haehnchen,项目名称:idea-php-annotation-plugin,代码行数:26,代码来源:ColumnNameCompletionProvider.java

示例3: getPropertyReferences

import com.jetbrains.php.lang.PhpLangUtil; //导入方法依赖的package包/类
@Nullable
@Override
public PsiReference[] getPropertyReferences(AnnotationPropertyParameter annotationPropertyParameter, PhpAnnotationReferenceProviderParameter referencesByElementParameter) {

    if(annotationPropertyParameter.getType() != AnnotationPropertyParameter.Type.PROPERTY_VALUE) {
        return null;
    }

    String propertyName = annotationPropertyParameter.getPropertyName();
    if(propertyName == null || !propertyName.equals("repositoryClass")) {
        return null;
    }

    String presentableFQN = annotationPropertyParameter.getPhpClass().getPresentableFQN();
    if(!PhpLangUtil.equalsClassNames("Doctrine\\ORM\\Mapping\\Entity", presentableFQN)) {
        return null;
    }

    return new PsiReference[] {
        new DoctrineRepositoryReference((StringLiteralExpression) annotationPropertyParameter.getElement())
    };

}
 
开发者ID:Haehnchen,项目名称:idea-php-annotation-plugin,代码行数:24,代码来源:DoctrineAnnotationTypeProvider.java

示例4: getPropertyValueCompletions

import com.jetbrains.php.lang.PhpLangUtil; //导入方法依赖的package包/类
@Override
public void getPropertyValueCompletions(AnnotationPropertyParameter parameter, AnnotationCompletionProviderParameter completion) {
    if(parameter.getType() != AnnotationPropertyParameter.Type.PROPERTY_ARRAY) {
        return;
    }

    if("methods".equals(parameter.getPropertyName()) && PhpLangUtil.equalsClassNames(StringUtils.stripStart(parameter.getPhpClass().getFQN(), "\\"), "Symfony\\Component\\Routing\\Annotation\\Route")) {
        for (String s : new String[]{"HEAD", "GET", "POST", "PUT", "PATCH", "DELETE", "PURGE", "OPTIONS", "TRACE", "CONNECT"}) {
            completion.getResult().addElement(LookupElementBuilder.create(s));
        }
    }
}
 
开发者ID:Haehnchen,项目名称:idea-php-annotation-plugin,代码行数:13,代码来源:SymfonyCompletionProvider.java

示例5: supports

import com.jetbrains.php.lang.PhpLangUtil; //导入方法依赖的package包/类
@Override
boolean supports(AnnotationPropertyParameter parameter) {
    return
        parameter.getType() == AnnotationPropertyParameter.Type.PROPERTY_VALUE &&
        "class".equals(parameter.getPropertyName()) &&
        PhpLangUtil.equalsClassNames(StringUtils.stripStart(parameter.getPhpClass().getFQN(), "\\"), "Doctrine\\ORM\\Mapping\\CustomIdGenerator");
}
 
开发者ID:Haehnchen,项目名称:idea-php-annotation-plugin,代码行数:8,代码来源:DoctrineCustomIdGenerator.java

示例6: supports

import com.jetbrains.php.lang.PhpLangUtil; //导入方法依赖的package包/类
@Override
boolean supports(AnnotationPropertyParameter parameter) {
    return
        parameter.getType() == AnnotationPropertyParameter.Type.PROPERTY_VALUE &&
        "class".equals(parameter.getPropertyName()) &&
        PhpLangUtil.equalsClassNames(StringUtils.stripStart(parameter.getPhpClass().getFQN(), "\\"), "Doctrine\\ORM\\Mapping\\Embedded");
}
 
开发者ID:Haehnchen,项目名称:idea-php-annotation-plugin,代码行数:8,代码来源:EmbeddedClassCompletionProvider.java

示例7: isSupported

import com.jetbrains.php.lang.PhpLangUtil; //导入方法依赖的package包/类
private boolean isSupported(@NotNull AnnotationPropertyParameter parameter) {
    return parameter.getType() != AnnotationPropertyParameter.Type.DEFAULT &&
        PhpLangUtil.equalsClassNames(StringUtils.stripStart(parameter.getPhpClass().getFQN(), "\\"), "Drupal\\Core\\Entity\\Annotation\\ConfigEntityType");
}
 
开发者ID:Haehnchen,项目名称:idea-php-drupal-symfony2-bridge,代码行数:5,代码来源:ConfigEntityTypeAnnotation.java

示例8: isSupported

import com.jetbrains.php.lang.PhpLangUtil; //导入方法依赖的package包/类
private boolean isSupported(@NotNull AnnotationPropertyParameter parameter) {
    return parameter.getType() == AnnotationPropertyParameter.Type.DEFAULT &&
        PhpLangUtil.equalsClassNames(StringUtils.stripStart(parameter.getPhpClass().getFQN(), "\\"), "Drupal\\Core\\Annotation\\Translation");
}
 
开发者ID:Haehnchen,项目名称:idea-php-drupal-symfony2-bridge,代码行数:5,代码来源:TranslationAnnotationReference.java

示例9: isSupported

import com.jetbrains.php.lang.PhpLangUtil; //导入方法依赖的package包/类
private boolean isSupported(@NotNull AnnotationPropertyParameter parameter) {
    return parameter.getType() != AnnotationPropertyParameter.Type.DEFAULT &&
        PhpLangUtil.equalsClassNames(StringUtils.stripStart(parameter.getPhpClass().getFQN(), "\\"), "Drupal\\Core\\Entity\\Annotation\\ContentEntityType");
}
 
开发者ID:Haehnchen,项目名称:idea-php-drupal-symfony2-bridge,代码行数:5,代码来源:ContentEntityTypeAnnotation.java


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