1 /**
2 * Copyright 2005-2015 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.rice.krad.uif.lifecycle;
17
18 import java.lang.annotation.Documented;
19 import java.lang.annotation.ElementType;
20 import java.lang.annotation.Retention;
21 import java.lang.annotation.RetentionPolicy;
22 import java.lang.annotation.Target;
23
24 /**
25 * Annotation for {@link org.kuali.rice.krad.uif.util.LifecycleElement} bean properties to restrict which view
26 * lifecycle phases for which the property will be considered while initializing the successor phase queue.
27 *
28 * <p>
29 * This annotation should be placed on the read method for any properties on the component that
30 * should be excluded from the view lifecycle. An optional array of phases at which the property
31 * should be included may be provided.
32 * </p>
33 *
34 * @author Kuali Rice Team (rice.collab@kuali.org)
35 */
36 @Target(ElementType.METHOD)
37 @Retention(RetentionPolicy.RUNTIME)
38 @Documented
39 public @interface ViewLifecycleRestriction {
40
41 /**
42 * Lifecycle phase (including preceding phases) at which to include the annotated bean property.
43 *
44 * @return lifecycle phase at which to include the annotated property
45 * @see org.kuali.rice.krad.uif.UifConstants.ViewPhases
46 */
47 String[] value() default {};
48
49 /**
50 * Lifecycle phase(s) at which to exclude the annotated bean property.
51 *
52 * <p>Note when this property is set by itself, all other phases not listed will be included. If value is
53 * set as well, only those phases within the value and not listed here will be included.</p>
54 *
55 * @return set of lifecycle phases at which to exclude the annotated property
56 * @see org.kuali.rice.krad.uif.UifConstants.ViewPhases
57 */
58 String[] exclude() default {};
59
60 /**
61 * Expression to evaluate (must result in boolean) that will determine if the property is included
62 * at the configured phases.
63 *
64 * <p>Expressions have access to the model as the default context. Also, no expression syntax (@{}) should
65 * be used.</p>
66 *
67 * @return String condition to evaluate
68 */
69 String condition() default "";
70
71 }