001package ball.annotation;
002/*-
003 * ##########################################################################
004 * Utilities
005 * %%
006 * Copyright (C) 2008 - 2022 Allen D. Ball
007 * %%
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *      http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 * ##########################################################################
020 */
021import java.lang.annotation.Documented;
022import java.lang.annotation.Retention;
023import java.lang.annotation.Target;
024
025import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
026import static java.lang.annotation.ElementType.PACKAGE;
027import static java.lang.annotation.ElementType.TYPE;
028import static java.lang.annotation.RetentionPolicy.RUNTIME;
029
030/**
031 * {@link java.lang.annotation.Annotation}s to generate a JAR
032 * {@link java.util.jar.Manifest META-INF/MANIFEST.MF}.
033 *
034 * @see ball.annotation.processing.ManifestProcessor
035 *
036 * @author {@link.uri mailto:ball@hcf.dev Allen D. Ball}
037 */
038public abstract class Manifest {
039    private Manifest() { }
040
041    /**
042     * Attribute name
043     */
044    @Documented
045    @Retention(RUNTIME)
046    @Target({ ANNOTATION_TYPE })
047    public @interface Attribute {
048        String value();
049    }
050
051    /**
052     * Main-Class
053     */
054    @Documented
055    @Retention(RUNTIME)
056    @Target({ TYPE })
057    @Attribute("Main-Class")
058    public @interface MainClass {
059    }
060
061    /**
062     * {@link Package} section
063     */
064    @Documented
065    @Retention(RUNTIME)
066    @Target({ PACKAGE })
067    public @interface Section {
068        boolean sealed() default true;
069    }
070
071    /**
072     * Java-Bean
073     */
074    @Documented
075    @Retention(RUNTIME)
076    @Target({ TYPE })
077    @Attribute("Java-Bean")
078    public @interface JavaBean {
079    }
080
081    /**
082     * Depends-On
083     */
084    @Documented
085    @Retention(RUNTIME)
086    @Target({ TYPE })
087    @Attribute("Depends-On")
088    public @interface DependsOn {
089        String[] value();
090    }
091
092    /**
093     * Design-Time-Only
094     */
095    @Documented
096    @Retention(RUNTIME)
097    @Target({ TYPE })
098    @Attribute("Design-Time-Only")
099    public @interface DesignTimeOnly {
100        String[] value();
101    }
102}