update copyright
[fedora-idea.git] / xml / dom-openapi / src / com / intellij / util / xml / NameValue.java
blobc531917d3c2ae747dc6324e7e168b0cbe76a0d35
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.util.xml;
18 import java.lang.annotation.Retention;
19 import java.lang.annotation.RetentionPolicy;
21 /**
22 * Annotate a method returning either {@link String} or {@link com.intellij.util.xml.GenericValue} with @NameValue,
23 * and {@link com.intellij.util.xml.ElementPresentationManager#getElementName(Object)} will return the resulting String
24 * or {@link GenericValue#getStringValue()}.
26 * @author peter
28 @Retention(RetentionPolicy.RUNTIME)
29 public @interface NameValue {
30 /**
31 * @return whether the element's name should be unique in some scope ({@link com.intellij.util.xml.DomFileDescription#getIdentityScope(DomElement)}).
32 * If true, then duplicate values will be highlighted as errors.
34 boolean unique() default true;
36 /**
37 * @return Only usable if the annotated method returns {@link com.intellij.util.xml.GenericDomValue}<Something>.
38 * Then this flag controls, whether a reference should be created from the @NameValue child XML element to
39 * the XML element of the annotated DOM element. Such reference is useful in rename refactoring to act as
40 * an element's declaration.
42 boolean referencable() default true;