Java 类com.intellij.psi.PsiTypeVisitor 实例源码

项目:google-cloud-intellij    文件:PsiUtils.java   
/**
 * Returns {@code true} if {@code type} is a parameterized type and {@code false} otherwise.
 *
 * @param type the type to be evaluated
 * @return {@code true} if {@code type} is a parameterized type and {@code false} otherwise
 */
public static boolean isParameterizedType(PsiType type) {
  if (!(type instanceof PsiClassType)) {
    return false;
  }

  Boolean accepted =
      type.accept(
          new PsiTypeVisitor<Boolean>() {
            @Nullable
            @Override
            public Boolean visitClassType(PsiClassType classType) {
              return classType.getParameterCount() > 0;
            }
          });
  return Boolean.TRUE.equals(accepted);
}
项目:intellij-ce-playground    文件:GrPsiTypeStub.java   
@Override
public <A> A accept(@NotNull PsiTypeVisitor<A> visitor) {
  return null;
}
项目:smogen    文件:Property.java   
/**
 * Accept a visitor on the property type.
 *
 * @return the result returned by the visitor
 */
@Nullable
public <T> T accept(PsiTypeVisitor<T> visitor) {
    return type.accept(visitor);
}