annotation modification tracker
[fedora-idea.git] / platform / lang-api / src / com / intellij / psi / util / PsiModificationTracker.java
blob6bd00d4c7b670277125c75a9d339e9b9daaaa3cd
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.psi.util;
18 import com.intellij.openapi.util.Key;
19 import com.intellij.openapi.util.ModificationTracker;
21 public interface PsiModificationTracker extends ModificationTracker {
23 /**
24 * This key can be passed as a dependency in a {@link com.intellij.psi.util.CachedValueProvider}.
25 * @see #getModificationCount()
27 Key MODIFICATION_COUNT = Key.create("MODIFICATION_COUNT");
29 /**
30 * This key can be passed as a dependency in a {@link com.intellij.psi.util.CachedValueProvider}.
31 * @see #getOutOfCodeBlockModificationCount()
33 Key OUT_OF_CODE_BLOCK_MODIFICATION_COUNT = Key.create("OUT_OF_CODE_BLOCK_MODIFICATION_COUNT");
35 /**
36 * This key can be passed as a dependency in a {@link com.intellij.psi.util.CachedValueProvider}.
37 * @see #getJavaStructureModificationCount()
39 Key JAVA_STRUCTURE_MODIFICATION_COUNT = Key.create("JAVA_STRUCTURE_MODIFICATION_COUNT");
41 /**
42 * Tracks any PSI modification.
43 * @return current counter value.
45 long getModificationCount();
47 long getOutOfCodeBlockModificationCount();
49 long getJavaStructureModificationCount();
51 /**
52 * Tracks modifications in Java annotations and annotated classes and methods.
53 * @return current counter value.
55 long getAnnotationModificationCount();
57 interface Listener {
58 void modificationCountChanged();