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 categories a document is associated with. A document may be 26 * added to none or any number of categories. 27 * <p> 28 * Categories are organized hierarchically. This organization is not reflected 29 * in the annotation. The annotations simply identify the categories by their 30 * name. 31 * </p> 32 * <p> 33 * Annotations found at the type level are inherited to the elements defined in 34 * this type. 35 * </p> 36 * <p> 37 * This is a filing element. 38 * </p> 39 * 40 * <pre> 41 * {@source "Usage Example" 42 * {@annotation}DocCategory("parent-category") 43 * public interface TestProperties 44 * { 45 * String inheritAll(); 46 * 47 * {@annotation}DocCategory({ "sample-category one" }) 48 * String oneValue(); 49 * 50 * {@annotation}DocCategory({ "sample-category one", "sample-category two", "sample-category three" }) 51 * String multipleValues(); 52 * } 53 * } 54 * </pre> 55 * 56 * @see Document 57 * @see DocParent 58 * @see DocTag 59 */ 60 @Documented 61 @Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD }) 62 @Retention(RetentionPolicy.RUNTIME) 63 public @interface DocCategory 64 { 65 /** 66 * The names of the categories the annotated element belongs to. 67 */ 68 String[] value(); 69 }