001/*
002 * Shredzone Commons
003 *
004 * Copyright (C) 2012 Richard "Shred" Körber
005 *   http://commons.shredzone.org
006 *
007 * This program is free software: you can redistribute it and/or modify
008 * it under the terms of the GNU Library General Public License as
009 * published by the Free Software Foundation, either version 3 of the
010 * License, or (at your option) any later version.
011 *
012 * This program is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015 * GNU General Public License for more details.
016 *
017 * You should have received a copy of the GNU Library General Public License
018 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
019 */
020package org.shredzone.commons.taglib.annotation;
021
022import java.lang.annotation.Documented;
023import java.lang.annotation.ElementType;
024import java.lang.annotation.Inherited;
025import java.lang.annotation.Retention;
026import java.lang.annotation.RetentionPolicy;
027import java.lang.annotation.Target;
028
029import javax.servlet.jsp.tagext.JspTag;
030import javax.servlet.jsp.tagext.TryCatchFinally;
031
032/**
033 * Annotates a Tag implementation class.
034 *
035 * @author Richard "Shred" Körber
036 */
037@Target(ElementType.TYPE)
038@Retention(RetentionPolicy.RUNTIME)
039@Inherited
040@Documented
041public @interface Tag {
042
043    /**
044     * Class type of the Tag.
045     * <p>
046     * Currently these types are supported:
047     * <ul>
048     *   <li>javax.servlet.jsp.tagext.Tag</li>
049     *   <li>javax.servlet.jsp.tagext.IterationTag</li>
050     *   <li>javax.servlet.jsp.tagext.BodyTag</li>
051     *   <li>javax.servlet.jsp.tagext.SimpleTag</li>
052     * </ul>
053     */
054    Class<? extends JspTag> type();
055
056    /**
057     * Name of the tag. Will be derived from the class name if none is given.
058     */
059    String name() default "";
060
061    /**
062     * Body content of the tag. Defaults to "JSP".
063     */
064    String bodycontent() default "JSP";
065
066    /**
067     * A custom spring bean name. Optional.
068     */
069    String bean() default "";
070
071    /**
072     * Does the tag class implements the {@link TryCatchFinally} implementation?
073     */
074    boolean tryCatchFinally() default false;
075
076}