| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
| InitialValue |
|
| 0.0;0 |
| 1 | package org.trails.descriptor.annotation; |
|
| 2 | ||
| 3 | import java.lang.annotation.ElementType; |
|
| 4 | import java.lang.annotation.Retention; |
|
| 5 | import java.lang.annotation.RetentionPolicy; |
|
| 6 | import java.lang.annotation.Target; |
|
| 7 | ||
| 8 | /** |
|
| 9 | * Annotation used to initialize a field based on an OGNL expression, usually |
|
| 10 | * another field. |
|
| 11 | * <p/> |
|
| 12 | * For example, assume you have a car of certain model made by certain make. |
|
| 13 | * The car has a relation to the model, but not the make. So you create a |
|
| 14 | * transient property make initialized by model.make.<br> |
|
| 15 | * |
|
| 16 | * @author pruggia |
|
| 17 | * @InitialValue("model.make")<br> This expression is only evaluated when editing the entity. |
|
| 18 | * <p/> |
|
| 19 | * See also {@link PossibleValues}. |
|
| 20 | */ |
|
| 21 | @Retention(RetentionPolicy.RUNTIME) |
|
| 22 | @Target({ElementType.FIELD, ElementType.METHOD}) |
|
| 23 | @DescriptorAnnotation(InitialValueAnnotationHandler.class) |
|
| 24 | public @interface InitialValue |
|
| 25 | { |
|
| 26 | ||
| 27 | /** |
|
| 28 | * The expression that when executed provides the initial value for the |
|
| 29 | * property. |
|
| 30 | */ |
|
| 31 | String value(); |
|
| 32 | } |
|
| 33 |