01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry.annotations;
16:
17: import static java.lang.annotation.ElementType.FIELD;
18: import static java.lang.annotation.RetentionPolicy.RUNTIME;
19:
20: import java.lang.annotation.Documented;
21: import java.lang.annotation.Retention;
22: import java.lang.annotation.Target;
23:
24: import org.apache.tapestry.services.ApplicationStateManager;
25:
26: /**
27: * Marker annotation for a field that is an <em>application state object</em> as controlled by the
28: * {@link ApplicationStateManager}.
29: * <p>
30: * An ASO file may have a companion field, of type boolean, used to see if the ASO has been created yet.
31: * If another field exists with the same name, suffixed with "Exists" (i.e., "_aso" for the ASO
32: * field, and "_asoExists" for the companion field) and the type of that field is boolean, then access
33: * to the field will determine whether the ASO has already been created. This is necessary because
34: * even a null check ("_aso != null") will force the ASO to be created. Instead, check te companion
35: * boolean field ("_asoExists").
36: */
37: @Target(FIELD)
38: @Documented
39: @Retention(RUNTIME)
40: public @interface ApplicationState {
41:
42: }
|