1 /*
2 * Project Bimbo.
3 * Copyright 2008 Frank Cornelis.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 package net.sf.bimbo;
19
20 import java.lang.annotation.Documented;
21 import java.lang.annotation.ElementType;
22 import java.lang.annotation.Retention;
23 import java.lang.annotation.RetentionPolicy;
24 import java.lang.annotation.Target;
25 import java.util.List;
26
27 /**
28 * Marks a field of your class as output element.
29 *
30 * <p>
31 * All basic Java types like {@link String}, {@link Integer}, {@link Float},
32 * {@link Double} can be used for output.
33 * </p>
34 *
35 * <p>
36 * A field of type {@link List} will be rendered as a table. If the list item
37 * class field are themselves also annotated with {@link Output} these fields
38 * will be rendered as columns within the table.
39 * </p>
40 *
41 * @author fcorneli
42 *
43 */
44 @Retention(RetentionPolicy.RUNTIME)
45 @Documented
46 @Target(ElementType.FIELD)
47 public @interface Output {
48 /**
49 * Used to enforce a verbatim output of the field value.
50 *
51 * @return
52 */
53 boolean verbatim() default false;
54
55 /**
56 * The optional label of the output element.
57 *
58 * @return
59 */
60 String value() default "";
61 }