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 */ 020 021package org.shredzone.commons.view.annotation; 022 023import java.lang.annotation.Documented; 024import java.lang.annotation.ElementType; 025import java.lang.annotation.Repeatable; 026import java.lang.annotation.Retention; 027import java.lang.annotation.RetentionPolicy; 028import java.lang.annotation.Target; 029 030/** 031 * A view handler method is annotated with {@link View}. 032 * <p> 033 * If a handler method is able to handle multiple views, {@link ViewGroup} is used 034 * instead to group several {@link View} annotations. 035 * 036 * @author Richard "Shred" Körber 037 */ 038@Target(ElementType.METHOD) 039@Retention(RetentionPolicy.RUNTIME) 040@Documented 041@Repeatable(ViewGroup.class) 042public @interface View { 043 044 /** 045 * View name. If unset, a view name is generated from the method name. 046 */ 047 String name() default ""; 048 049 /** 050 * View pattern. This is the view's url with additional placeholders. 051 */ 052 String pattern(); 053 054 /** 055 * View signature. If unset, the signature is automatically generated from the pattern 056 * placeholders. 057 */ 058 String[] signature() default {}; 059 060 /** 061 * View handler qualifier. If unset, the standard qualifier is used. 062 */ 063 String qualifier() default ""; 064 065}