001    package org.tynamo.descriptor.annotation;
002    
003    import java.lang.annotation.ElementType;
004    import java.lang.annotation.Retention;
005    import java.lang.annotation.RetentionPolicy;
006    import java.lang.annotation.Target;
007    
008    /**
009     * Annotation used to declare filter options from a select based on
010     * other property.
011     * <p/>
012     * The most common example of this is selecting a State based on the value of
013     * the country property. If the property you want to filter by is named
014     * "countryFilter" and the Country class has a property named "states" you
015     * should annotate the state property in this way:<br>
016     *
017     * @author pruggia
018     * @PossibleValues("countryFilter.states")<br> <br>
019     * Don't forget to add a {@link InitialValue} to the filtering
020     * property.
021     */
022    @Retention(RetentionPolicy.RUNTIME)
023    @Target({ElementType.FIELD, ElementType.METHOD})
024    @DescriptorAnnotation(PossibleValuesAnnotationHandler.class)
025    public @interface PossibleValues
026    {
027    
028            /**
029             * The expression that when executed provides the options to select values
030             * from.
031             */
032            String value();
033    }
034