View Javadoc

1   /*
2    * Copyright 2012 smartics, Kronseder & Reiner GmbH
3    *
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
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
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.
15   */
16  package de.smartics.projectdoc.annotations;
17  
18  import java.lang.annotation.Documented;
19  import java.lang.annotation.ElementType;
20  import java.lang.annotation.Retention;
21  import java.lang.annotation.RetentionPolicy;
22  import java.lang.annotation.Target;
23  
24  /**
25   * Specifies the parents a document is a child of. A document may have none or
26   * any number of parents.
27   * <p>
28   * Annotations found at the type level are <strong>not</strong> inherited to the
29   * elements defined in this type.
30   * </p>
31   * <p>
32   * This is a filing element.
33   * </p>
34   *
35   * <pre>
36   * {@source "Usage Example"
37   * {@annotation}DocParent("type-parent")
38   *   public interface TestProperties
39   *   {
40   *     String inheritAll();
41   *
42   *     {@annotation}DocParent({ "sample one" })
43   *     String oneValue();
44   *
45   *     {@annotation}DocParent({ "sample one", "sample two", "sample three" })
46   *     String multipleValues();
47   *   }
48   * }
49   * </pre>
50   *
51   * @see Document
52   * @see DocCategory
53   * @see DocTag
54   */
55  @Documented
56  @Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD })
57  @Retention(RetentionPolicy.RUNTIME)
58  public @interface DocParent
59  {
60    /**
61     * The names of the parents of the annotated element.
62     */
63    String[] value();
64  }