001/*
002 * ModeShape (http://www.modeshape.org)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *       http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.modeshape.common.annotation;
017
018import static java.lang.annotation.ElementType.CONSTRUCTOR;
019import static java.lang.annotation.ElementType.FIELD;
020import static java.lang.annotation.ElementType.METHOD;
021import static java.lang.annotation.ElementType.PACKAGE;
022import static java.lang.annotation.ElementType.TYPE;
023import static java.lang.annotation.RetentionPolicy.RUNTIME;
024import java.lang.annotation.Documented;
025import java.lang.annotation.Retention;
026import java.lang.annotation.Target;
027import org.modeshape.common.i18n.I18n;
028
029/**
030 * Annotation that can be used provide a human-readable category.
031 */
032@Documented
033@Retention( RUNTIME )
034@Target( {FIELD, METHOD, CONSTRUCTOR, PACKAGE, TYPE} )
035public @interface Category {
036    /**
037     * The label for the element. This value can either be the literal label, or it can be the {@link I18n#id() identifier} of an
038     * {@link I18n} instance on the non-null {@link #i18n()} I18n container class.
039     * 
040     * @return the issue
041     */
042    String value();
043
044    /**
045     * The class that contains the {@link I18n} instances used for internationalization. This may be null if the description is a
046     * literal value.
047     * 
048     * @return the class that contains the I18n instance identified by the {@link #value()}
049     */
050    Class<?> i18n();
051}