Generic Filter: programmatic API is inconvenient and unsafe #5083#5090
Draft
fractal3000 wants to merge 5 commits intomasterfrom
Draft
Generic Filter: programmatic API is inconvenient and unsafe #5083#5090fractal3000 wants to merge 5 commits intomasterfrom
fractal3000 wants to merge 5 commits intomasterfrom
Conversation
- Add MutableConfiguration interface extending Configuration; RunTimeConfiguration now implements it, giving compile-time safety against calling mutating methods on DesignTimeConfiguration - Fix RunTimeConfiguration: subscribe to FilterComponentsChangeEvent from the root component so that components added after construction are automatically marked as modified (remove buttons appear without a manual setModified call) - Add FilterComponentBuilder with PropertyFilterBuilder, JpqlFilterBuilder and GroupFilterBuilder: encapsulates mandatory init steps (setConditionModificationDelegated, setDataLoader, correct property→operation→value ordering) - Add DesignTimeConfigurationBuilder and RunTimeConfigurationBuilder: fluent API for creating and registering configurations with automatic setFilterComponentDefaultValue - Add GenericFilter.refreshCurrentConfiguration(), addAndSetCurrentConfiguration(), componentBuilder(), configurationBuilder(), runtimeConfigurationBuilder() All changes are purely additive; no existing classes or methods are modified. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ilders - Add GenericFilterBuilderApiTest: 24 narrow integration tests (Spock/Spring) that serve as executable documentation for FilterComponentBuilder, DesignTimeConfigurationBuilder, RunTimeConfigurationBuilder, RunTimeConfiguration auto-tracking, and the GenericFilter helper methods (addAndSetCurrentConfiguration, refreshCurrentConfiguration, setCurrentConfiguration silent-ignore behaviour). Class-level Javadoc explains why isolated unit tests are not practical for these classes (Spring/Vaadin bootstrapping requirements). - Guard setValue() in DesignTimeConfigurationBuilder and RunTimeConfigurationBuilder with a best-effort try-catch: the component's value may not be fully initialised when no DataLoader is assigned (tests, lazy initialisation). The configuration default value is always persisted via setFilterComponentDefaultValue regardless of whether setValue succeeds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… 3.0) Six mutating methods that throw UnsupportedOperationException when called on DesignTimeConfiguration are now marked @deprecated(since = "2.8", forRemoval = true) in the Configuration interface: setName, setRootLogicalFilterComponent, setModified, setFilterComponentModified, resetFilterComponentDefaultValue, resetAllDefaultValues. Migration path documented in the Configuration class Javadoc: - Declare variables/parameters as MutableConfiguration (implemented only by RunTimeConfiguration) to get compile-time safety and no deprecation warning. - Use (config instanceof MutableConfiguration) for dynamic checks. MutableConfiguration re-declares all six methods without @deprecated, so callers that already use MutableConfiguration or RunTimeConfiguration see no new warnings. DesignTimeConfiguration gets a brief note explaining the connection to the deprecation and the 3.0 plan. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add @internal to classes and sub-packages that are framework implementation details and should not be used by application developers: - GenericFilterActionsSupport - FilterUtils (class level; methods already had it) - FilterConfigurationPersistence - FilterComponents (registration) - inspector/ package (new package-info.java) - model/ package (new package-info.java) FilterComponentRegistration and FilterComponentRegistrationBuilder remain public: they are the intentional SPI for add-on developers registering custom filter component types. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#5083