/*
 * Copyright 2000-2009 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.util.xml.highlighting;

import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemHighlightType;
import com.intellij.lang.annotation.Annotation;
import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiReference;
import com.intellij.util.xml.DomElement;
import com.intellij.util.xml.DomFileElement;
import com.intellij.util.xml.GenericDomValue;
import com.intellij.util.xml.reflect.DomCollectionChildDescription;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface DomElementAnnotationHolder extends Iterable<DomElementProblemDescriptor>{

  boolean isOnTheFly();

  @NotNull
  DomFileElement<?> getFileElement();

  @NotNull
  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, @Nullable String message, LocalQuickFix... fixes);

  @NotNull
  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, DomCollectionChildDescription childDescription, @Nullable String message);

  @NotNull
  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message);

  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message, LocalQuickFix... fixes);

  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message, TextRange textRange, LocalQuickFix... fixes);

  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, ProblemHighlightType highlightType, String message, @Nullable TextRange textRange, LocalQuickFix... fixes);

  @NotNull
  DomElementResolveProblemDescriptor createResolveProblem(@NotNull GenericDomValue element, @NotNull PsiReference reference);

  /**
   * Is useful only if called from {@link com.intellij.util.xml.highlighting.DomElementsAnnotator} instance
   * @param element element
   * @param severity highlight severity
   * @param message description
   * @return annotation
   */
  @NotNull
  Annotation createAnnotation(@NotNull DomElement element, HighlightSeverity severity, @Nullable String message);

  int getSize();
}

@@ -1,13 +1,10 @@
 /
-*%0A *
+/
  Copyrig
@@ -17,10 +17,10 @@
 0-20
+2
 0
-9
  Jet
@@ -36,566 +36,109 @@
 r.o.
-%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */
+ Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 %0Apac
@@ -667,24 +667,62 @@
 escription;%0A
+import org.jetbrains.annotations.Nls;%0A
 import org.j
@@ -884,16 +884,17 @@
 criptor%3E
+ 
 %7B%0A%0A  boo
@@ -1053,34 +1053,173 @@
 ent,
- @Nullable String message,
+%0A                                            @Nullable @Nls(capitalization = Nls.Capitalization.Sentence) String message,%0A                                           
  Loc
@@ -1327,16 +1327,60 @@
 Element,
+%0A                                           
  DomColl
@@ -1423,656 +1423,1527 @@
 ion,
- @Nullable String message);%0A%0A  @NotNull%0A  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message);%0A%0A  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message, LocalQuickFix... fixes);%0A%0A  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, HighlightSeverity highlightType, String message, TextRange textRange, LocalQuickFix... fixes);%0A%0A  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement, ProblemHighlightType highlightType, String message, @Nullable TextRange textRange,
+%0A                                            @Nullable @Nls(capitalization = Nls.Capitalization.Sentence) String message);%0A%0A  @NotNull%0A  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement,%0A                                            HighlightSeverity highlightType,%0A                                            @Nls(capitalization = Nls.Capitalization.Sentence) String message);%0A%0A  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement,%0A                                            HighlightSeverity highlightType,%0A                                            @Nls(capitalization = Nls.Capitalization.Sentence) String message,%0A                                            LocalQuickFix... fixes);%0A%0A  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement,%0A                                            HighlightSeverity highlightType,%0A                                            @Nls(capitalization = Nls.Capitalization.Sentence) String message,%0A                                            TextRange textRange,%0A                                            LocalQuickFix... fixes);%0A%0A  DomElementProblemDescriptor createProblem(@NotNull DomElement domElement,%0A                                            ProblemHighlightType highlightType,%0A                                            @Nls(capitalization = Nls.Capitalization.Sentence) String message,%0A                                            @Nullable TextRange textRange,%0A                                           
  Loc
@@ -3217,16 +3217,21 @@
 nstance%0A
+   *%0A
    * @pa
@@ -3238,24 +3238,25 @@
 ram element 
+ 
 element%0A   *
@@ -3311,16 +3311,17 @@
 message 
+ 
 descript

add @Nls