01: // Copyright 2006 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.Environment;
25:
26: /**
27: * Defines a field that is replaced at runtime with a read-only value obtained from the
28: * {@link Environment} service.
29: */
30: @Target(FIELD)
31: @Documented
32: @Retention(RUNTIME)
33: public @interface Environmental {
34: /**
35: * The value determines if the environmental service to be injected is required or not. In most
36: * cases, it is, so the default is true.
37: */
38: boolean value() default true;
39: }
|