本文整理汇总了Java中com.intellij.psi.scope.NameHint.getName方法的典型用法代码示例。如果您正苦于以下问题:Java NameHint.getName方法的具体用法?Java NameHint.getName怎么用?Java NameHint.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.scope.NameHint
的用法示例。
在下文中一共展示了NameHint.getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processDeclarationsInClass
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
private static boolean processDeclarationsInClass(@NotNull PsiClass aClass,
@NotNull final PsiScopeProcessor processor,
@NotNull ResolveState state,
@Nullable Set<PsiClass> visited,
PsiElement last,
@NotNull PsiElement place,
@NotNull LanguageLevel languageLevel,
boolean isRaw,
@NotNull GlobalSearchScope resolveScope) {
if (last instanceof PsiTypeParameterList || last instanceof PsiModifierList) {
return true; //TypeParameterList and ModifierList do not see our declarations
}
if (visited != null && visited.contains(aClass)) return true;
PsiSubstitutor substitutor = state.get(PsiSubstitutor.KEY);
isRaw = isRaw || PsiUtil.isRawSubstitutor(aClass, substitutor);
final NameHint nameHint = processor.getHint(NameHint.KEY);
if (nameHint != null) {
String name = nameHint.getName(state);
return processCachedMembersByName(aClass, processor, state, visited, last, place, isRaw, substitutor,
getValues(aClass).getValue(aClass).get(resolveScope), name,languageLevel);
}
return processDeclarationsInClassNotCached(aClass, processor, state, visited, last, place, isRaw, languageLevel, resolveScope);
}
示例2: processDeclarations
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
ElementClassHint classHint = processor.getHint(ElementClassHint.KEY);
if (classHint == null || classHint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) {
final NameHint nameHint = processor.getHint(NameHint.KEY);
final String name = nameHint != null ? nameHint.getName(state) : null;
//"pseudo-imports"
if (name != null) {
PsiClass imported = myPseudoImports.get(name);
if (imported != null) {
if (!processor.execute(imported, state)) return false;
}
} else {
for (PsiClass aClass : myPseudoImports.values()) {
if (!processor.execute(aClass, state)) return false;
}
}
if (myContext == null) {
if (!JavaResolveUtil.processImplicitlyImportedPackages(processor, state, place, getManager())) return false;
}
}
return true;
}
示例3: processMethods
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
public boolean processMethods(PsiScopeProcessor processor, @NotNull ResolveState state, PsiType qualifierType, Project project) {
if (qualifierType == null) return true;
NameHint nameHint = processor.getHint(NameHint.KEY);
String name = nameHint == null ? null : nameHint.getName(state);
final MultiMap<String, PsiMethod> map = name != null ? myOriginalMethodsByNameAndType.get(name) : myOriginalMethodByType.getValue();
if (map.isEmpty()) {
return true;
}
for (String superType : ResolveUtil.getAllSuperTypes(qualifierType, project)) {
for (PsiMethod method : map.get(superType)) {
String info = GdkMethodUtil.generateOriginInfo(method);
GrGdkMethod gdk = GrGdkMethodImpl.createGdkMethod(method, myStatic, info);
if (!processor.execute(gdk, state)) {
return false;
}
}
}
return true;
}
示例4: processDeclarations
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor,
@NotNull ResolveState state,
@Nullable PsiElement lastParent,
@NotNull PsiElement place) {
if (ResolveUtil.shouldProcessMethods(processor.getHint(ClassHint.KEY))) {
final NameHint nameHint = processor.getHint(NameHint.KEY);
final String name = nameHint == null ? null : nameHint.getName(state);
for (PsiMethod method : getDefEnumMethods()) {
if (name == null || name.equals(method.getName())) {
if (!processor.execute(method, state)) return false;
}
}
}
return super.processDeclarations(processor, state, lastParent, place);
}
示例5: processMethods
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
public boolean processMethods(PsiScopeProcessor processor, ResolveState state, PsiType qualifierType, Project project) {
if (qualifierType == null) return true;
NameHint nameHint = processor.getHint(NameHint.KEY);
String name = nameHint == null ? null : nameHint.getName(state);
final MultiMap<String, PsiMethod> map = name != null ? myOriginalMethodsByNameAndType.get(name) : myOriginalMethodByType.getValue();
if (map.isEmpty()) {
return true;
}
for (String superType : ResolveUtil.getAllSuperTypes(qualifierType, project).keySet()) {
for (PsiMethod method : map.get(superType)) {
String info = GdkMethodUtil.generateOriginInfo(method);
GrGdkMethod gdk = GrGdkMethodImpl.createGdkMethod(method, myStatic, info);
if (!processor.execute(gdk, state)) {
return false;
}
}
}
return true;
}
示例6: processDeclarations
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor,
@NotNull ResolveState state,
@Nullable PsiElement lastParent,
@NotNull PsiElement place) {
ClassHint classHint = processor.getHint(ClassHint.KEY);
if (classHint == null || classHint.shouldProcess(ClassHint.ResolveKind.METHOD)) {
final NameHint nameHint = processor.getHint(NameHint.KEY);
final String name = nameHint == null ? null : nameHint.getName(state);
for (PsiMethod method : getDefEnumMethods()) {
if (name == null || name.equals(method.getName())) {
if (!processor.execute(method, state)) return false;
}
}
}
return super.processDeclarations(processor, state, lastParent, place);
}
示例7: processDeclarations
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
if (lastParent == null) {
// Parent element should not see our vars
return true;
}
Couple<Set<String>> pair = buildMaps();
boolean conflict = pair == null;
final Set<String> classesSet = conflict ? null : pair.getFirst();
final Set<String> variablesSet = conflict ? null : pair.getSecond();
final NameHint hint = processor.getHint(NameHint.KEY);
if (hint != null && !conflict) {
final ElementClassHint elementClassHint = processor.getHint(ElementClassHint.KEY);
final String name = hint.getName(state);
if ((elementClassHint == null || elementClassHint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) && classesSet.contains(name)) {
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
if ((elementClassHint == null || elementClassHint.shouldProcess(ElementClassHint.DeclarationKind.VARIABLE)) && variablesSet.contains(name)) {
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
}
else {
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
return true;
}
示例8: getNameHint
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
@Nullable
public static String getNameHint(PsiScopeProcessor processor) {
NameHint nameHint = processor.getHint(NameHint.KEY);
if (nameHint == null) {
return null;
}
return nameHint.getName(ResolveState.initial());
}
示例9: processElement
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
public static boolean processElement(@NotNull PsiScopeProcessor processor,
@NotNull PsiNamedElement namedElement,
@NotNull ResolveState state) {
NameHint nameHint = processor.getHint(NameHint.KEY);
String name = nameHint == null ? null : nameHint.getName(state);
if (name == null || name.equals(namedElement.getName())) {
return processor.execute(namedElement, state);
}
return true;
}
示例10: processSingleStaticImport
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
private boolean processSingleStaticImport(@NotNull final PsiScopeProcessor processor,
@NotNull ResolveState state,
@NotNull String importedName,
@Nullable PsiElement lastParent,
@NotNull PsiElement place) {
final GrCodeReferenceElement ref = getImportReference();
if (ref == null) return true;
PsiClass clazz = resolveQualifier();
if (clazz == null) return true;
state = state.put(ClassHint.RESOLVE_CONTEXT, this);
final String refName = ref.getReferenceName();
final NameHint nameHint = processor.getHint(NameHint.KEY);
final String hintName = nameHint == null ? null : nameHint.getName(state);
if (hintName == null || importedName.equals(hintName)) {
if (!clazz.processDeclarations(new GrDelegatingScopeProcessorWithHints(processor, refName, null), state, lastParent, place)) {
return false;
}
}
if (ResolveUtil.shouldProcessMethods(processor.getHint(ClassHint.KEY))) {
if (hintName == null || importedName.equals(GroovyPropertyUtils.getPropertyNameByGetterName(hintName, true))) {
if (!clazz.processDeclarations(new StaticGetterProcessor(refName, processor), state, lastParent, place)) {
return false;
}
}
if (hintName == null || importedName.equals(GroovyPropertyUtils.getPropertyNameBySetterName(hintName))) {
if (!clazz.processDeclarations(new StaticSetterProcessor(refName, processor), state, lastParent, place)) {
return false;
}
}
}
return true;
}
示例11: processDeclarationsInClass
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
public static boolean processDeclarationsInClass(@NotNull PsiClass aClass,
@NotNull final PsiScopeProcessor processor,
@NotNull ResolveState state,
@Nullable Set<PsiClass> visited,
PsiElement last,
@NotNull PsiElement place,
@NotNull LanguageLevel languageLevel,
boolean isRaw) {
if (last instanceof PsiTypeParameterList || last instanceof PsiModifierList) {
return true; //TypeParameterList and ModifierList do not see our declarations
}
if (visited != null && visited.contains(aClass)) return true;
PsiSubstitutor substitutor = state.get(PsiSubstitutor.KEY);
isRaw = isRaw || PsiUtil.isRawSubstitutor(aClass, substitutor);
ParameterizedCachedValue<MembersMap, PsiClass> cache = getValues(aClass); //aClass.getUserData(MAP_IN_CLASS_KEY);
boolean upToDate = cache.hasUpToDateValue();
if (/*true || */upToDate) {
final NameHint nameHint = processor.getHint(NameHint.KEY);
if (nameHint != null) {
String name = nameHint.getName(state);
return processCachedMembersByName(aClass, processor, state, visited, last, place, isRaw, substitutor, cache.getValue(aClass), name,languageLevel);
}
}
return processDeclarationsInClassNotCached(aClass, processor, state, visited, last, place, isRaw, languageLevel);
}
示例12: processDeclarations
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
@Override
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) {
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
if (lastParent == null) {
// Parent element should not see our vars
return true;
}
Pair<Set<String>, Set<String>> pair = buildMaps();
boolean conflict = pair == null;
final Set<String> classesSet = conflict ? null : pair.getFirst();
final Set<String> variablesSet = conflict ? null : pair.getSecond();
final NameHint hint = processor.getHint(NameHint.KEY);
if (hint != null && !conflict) {
final ElementClassHint elementClassHint = processor.getHint(ElementClassHint.KEY);
final String name = hint.getName(state);
if ((elementClassHint == null || elementClassHint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) && classesSet.contains(name)) {
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
if ((elementClassHint == null || elementClassHint.shouldProcess(ElementClassHint.DeclarationKind.VARIABLE)) && variablesSet.contains(name)) {
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
}
else {
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
return true;
}
示例13: processElement
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
public static boolean processElement(@NotNull PsiScopeProcessor processor, @NotNull PsiNamedElement namedElement, @NotNull ResolveState state) {
NameHint nameHint = processor.getHint(NameHint.KEY);
String name = nameHint == null ? null : nameHint.getName(state);
if (name == null || name.equals(namedElement.getName())) {
return processor.execute(namedElement, state);
}
return true;
}
示例14: processImpl
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
private boolean processImpl(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place)
{
processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, this);
if(lastParent == null)
{
// Parent element should not see our vars
return true;
}
Pair<Set<String>, Set<String>> pair = buildMaps();
boolean conflict = pair == null;
final Set<String> classesSet = conflict ? null : pair.getFirst();
final Set<String> variablesSet = conflict ? null : pair.getSecond();
final NameHint hint = processor.getHint(NameHint.KEY);
if(hint != null && !conflict)
{
final ElementClassHint elementClassHint = processor.getHint(ElementClassHint.KEY);
final String name = hint.getName(state);
if((elementClassHint == null || elementClassHint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) && classesSet.contains(name))
{
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
if((elementClassHint == null || elementClassHint.shouldProcess(ElementClassHint.DeclarationKind.VARIABLE)) && variablesSet.contains(name))
{
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
}
else
{
return PsiScopesUtil.walkChildrenScopes(this, processor, state, lastParent, place);
}
return true;
}
示例15: processElement
import com.intellij.psi.scope.NameHint; //导入方法依赖的package包/类
public static boolean processElement(PsiScopeProcessor processor, PsiNamedElement namedElement) {
if (namedElement == null) return true;
NameHint nameHint = processor.getHint(NameHint.KEY);
String name = nameHint == null ? null : nameHint.getName(ResolveState.initial());
if (name == null || name.equals(namedElement.getName())) {
return processor.execute(namedElement, ResolveState.initial());
}
return true;
}