001/*
002Copyright (c) 2006,2007, Bruce Chapman
003
004All rights reserved.
005
006Redistribution and use in source and binary forms, with or without modification,
007 are permitted provided that the following conditions are met:
008
009    * Redistributions of source code must retain the above copyright notice,
010      this list of conditions and the following disclaimer.
011    * Redistributions in binary form must reproduce the above copyright notice,
012      this list of conditions and the following disclaimer in the documentation and/or
013      other materials provided with the distribution.
014    * Neither the name of the Hickory project nor the names of its contributors
015      may be used to endorse or promote products derived from this software without
016      specific prior written permission.
017
018THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
019"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
020LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
021A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
022CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
023EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
025PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
026LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
027NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
028SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
029*/
030
031/*
032 * GeneratePrism.java
033 *
034 * Created on 27 June 2006, 21:58
035 *
036 */
037package io.jstach.prism;
038
039import java.lang.annotation.ElementType;
040import java.lang.annotation.Retention;
041import java.lang.annotation.Repeatable;
042import java.lang.annotation.RetentionPolicy;
043import java.lang.annotation.Target;
044
045/**
046 * Generates a Prism for the specified annotation, in the same package as the target.
047 *
048 * <p>
049 * If multiple @Prism annotations specifying the same value() (and name()) are present
050 * within one package, only one Prism will be generated and no error will be raised.
051 */
052@Target({ ElementType.PACKAGE, ElementType.TYPE })
053@Retention(RetentionPolicy.SOURCE)
054@Repeatable(GeneratePrisms.class)
055public @interface GeneratePrism {
056
057        /**
058         * The annotation to generate a prism for.
059         * @return annotation class.
060         */
061        Class<? extends java.lang.annotation.Annotation> value();
062
063        /**
064         * The name of the generated prism class. Defaults to XXPrism where XX is the simple
065         * name of the annotation specified by value().
066         * @return The name of the generated prism class.
067         */
068        String name() default "";
069
070        /**
071         * Set to true for the prism to have public access, otherwise the generated prism and
072         * its members will be package visible. The default is sufficient if the prism is
073         * generated in the same package as the AnnotationProcessor which uses them.
074         * @return if the prism is to be made public
075         */
076        boolean publicAccess() default false;
077
078}