update copyright
[fedora-idea.git] / java / java-impl / src / com / intellij / codeInsight / daemon / JavaAwareInspectionProfileCoverter.java
blobe79fdbe14ed92eb536888de41c524485325c4464
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.
18 * User: anna
19 * Date: 21-Feb-2008
21 package com.intellij.codeInsight.daemon;
23 import com.intellij.codeInspection.InspectionProfileEntry;
24 import com.intellij.codeInspection.ModifiableModel;
25 import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
26 import com.intellij.codeInspection.javaDoc.JavaDocLocalInspection;
27 import com.intellij.profile.codeInspection.InspectionProfileManager;
28 import org.jdom.Element;
29 import org.jetbrains.annotations.NonNls;
31 public class JavaAwareInspectionProfileCoverter extends InspectionProfileConvertor{
32 private String myAdditionalJavadocTags;
33 @NonNls private static final String ADDITONAL_JAVADOC_TAGS_OPTION = "ADDITIONAL_JAVADOC_TAGS";
35 public JavaAwareInspectionProfileCoverter(InspectionProfileManager manager) {
36 super(manager);
39 @Override
40 protected boolean processElement(final Element option, final String name) {
41 if (super.processElement(option, name)) {
42 return true;
44 if (name.equals(ADDITONAL_JAVADOC_TAGS_OPTION)) {
45 myAdditionalJavadocTags = option.getAttributeValue(VALUE_ATT);
46 return true;
48 return false;
51 @Override
52 protected void fillErrorLevels(final ModifiableModel profile) {
53 super.fillErrorLevels(profile);
55 //javadoc attributes
56 final InspectionProfileEntry inspectionTool = profile.getInspectionTool(JavaDocLocalInspection.SHORT_NAME, null);
57 JavaDocLocalInspection inspection = (JavaDocLocalInspection)((LocalInspectionToolWrapper)inspectionTool).getTool();
58 inspection.myAdditionalJavadocTags = myAdditionalJavadocTags;