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


Java CommonClassNames.JAVA_LANG_OBJECT属性代码示例

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


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

示例1: checkApplicability

@Override
public boolean checkApplicability(@NotNull AnnotationHolder holder, @NotNull GrAnnotation annotation) {
  if (GroovyCommonClassNames.GROOVY_TRANSFORM_BASE_SCRIPT.equals(annotation.getQualifiedName())) {
    PsiFile file = annotation.getContainingFile();
    if (file instanceof GroovyFile && !(((GroovyFile)file).isScript())) {
      holder.createErrorAnnotation(annotation, GroovyBundle.message("base.script.annotation.is.allowed.only.inside.scripts"));
      return true;
    }

    PsiElement pparent = annotation.getParent().getParent();
    if (pparent instanceof GrVariableDeclaration) {
      GrTypeElement typeElement = ((GrVariableDeclaration)pparent).getTypeElementGroovy();
      PsiType type = typeElement != null ? typeElement.getType() : null;

      if (!InheritanceUtil.isInheritor(type, GroovyCommonClassNames.GROOVY_LANG_SCRIPT)) {
        String typeText = type != null ? type.getCanonicalText() : CommonClassNames.JAVA_LANG_OBJECT;
        holder.createErrorAnnotation(annotation, GroovyBundle.message("declared.type.0.have.to.extend.script", typeText));
        return true;
      }
    }
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:BaseScriptAnnotationChecker.java

示例2: getPsi

@Override
@NotNull
public PsiVariable getPsi(PsiManager manager, final String containingClassName) {
  if (myPsi != null) return myPsi;

  Boolean isStatic = isStatic();

  String type = getType();
  if (type == null || type.trim().isEmpty()) {
    type = CommonClassNames.JAVA_LANG_OBJECT;
  }
  myPsi = new GrDynamicImplicitProperty(manager, getName(), type, containingClassName);

  if (isStatic != null && isStatic.booleanValue()) {
    myPsi.getModifierList().addModifier(PsiModifier.STATIC);
  }

  return myPsi;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DPropertyElement.java

示例3: getQualifiedClassName

@Override
public String getQualifiedClassName(PsiClass psiClass, @Nullable PsiElement context) {
  if (context != null && psiClass != null) {
    psiClass = GenerationUtil.findAccessibleSuperClass(context, psiClass);
  }
  if (psiClass == null) {
    return CommonClassNames.JAVA_LANG_OBJECT;
  }

  final String name = psiClass.getQualifiedName();
  if (name != null) return name;
  return psiClass.getName();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:GeneratorClassNameProvider.java

示例4: ReferenceRenderer

protected ReferenceRenderer() {
  this(CommonClassNames.JAVA_LANG_OBJECT);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:ReferenceRenderer.java

示例5: GrBindingVariable

public GrBindingVariable(final GroovyFile file, String name, Boolean isWriteAccess) {
  super(file.getManager(), name, CommonClassNames.JAVA_LANG_OBJECT, file);
  myFile = file;
  myHasWriteAccess = isWriteAccess;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GrBindingVariable.java


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