2 * Copyright (c) 2000-2005 by JetBrains s.r.o. All Rights Reserved.
3 * Use is subject to license terms.
5 package com
.intellij
.psi
;
7 import com
.intellij
.openapi
.project
.Project
;
8 import com
.intellij
.patterns
.ElementPattern
;
9 import com
.intellij
.patterns
.PlatformPatterns
;
10 import com
.intellij
.patterns
.StandardPatterns
;
11 import com
.intellij
.pom
.references
.PomReferenceProvider
;
12 import org
.jetbrains
.annotations
.NotNull
;
17 public abstract class PsiReferenceRegistrar
{
18 public static final double DEFAULT_PRIORITY
= 0.0;
19 public static final double HIGHER_PRIORITY
= 100.0;
20 public static final double LOWER_PRIORITY
= -100.0;
23 * Register reference provider with default priority ({@link #DEFAULT_PRIORITY})
24 * @param pattern reference place description. See {@link StandardPatterns}, {@link PlatformPatterns} and their extenders
27 public void registerReferenceProvider(@NotNull ElementPattern
<?
extends PsiElement
> pattern
, @NotNull PsiReferenceProvider provider
) {
28 registerReferenceProvider(pattern
, provider
, DEFAULT_PRIORITY
);
33 * Register reference provider
34 * @param pattern reference place description. See {@link StandardPatterns}, {@link PlatformPatterns} and their extenders
36 * @param priority @see DEFAULT_PRIORITY, HIGHER_PRIORITY, LOWER_PRIORITY
38 public abstract <T
extends PsiElement
> void registerReferenceProvider(@NotNull ElementPattern
<T
> pattern
, @NotNull PsiReferenceProvider provider
, double priority
);
40 public <T
extends PsiElement
> void registerReferenceProvider(@NotNull ElementPattern
<T
> pattern
, @NotNull PomReferenceProvider
<T
> provider
) {
41 registerReferenceProvider(pattern
, provider
, DEFAULT_PRIORITY
);
44 public abstract <T
extends PsiElement
> void registerReferenceProvider(@NotNull ElementPattern
<T
> pattern
, @NotNull PomReferenceProvider
<T
> provider
, double priority
);
47 * Return the project to register providers for.
48 * @return project or null, if POM references are registered
51 public abstract Project
getProject();