Reflective discovery of styleable properties
Andy Goryachev
andy.goryachev at oracle.com
Thu Dec 7 23:00:47 UTC 2023
Could it be done with annotations alone?
CssMetaData requires the following:
- property name
- object type
- converter
- initial value
- inherits
- list of sub-properties (of type List<CssMetaData<? extends Styleable, ?>>) see Region
But, if it is indeed possible, it would be a very good solution.
-andy
From: openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of Michael Strauß <michaelstrau2 at gmail.com>
Date: Thursday, December 7, 2023 at 14:51
To:
Cc: openjfx-dev <openjfx-dev at openjdk.org>
Subject: Re: Reflective discovery of styleable properties
We could also use reflection in combination with annotations. You'd
need to annotate every CSS-styleable property (a simple @Styleable
annotation would suffice), and at runtime we can discover the
annotated methods and reflect their metadata.
This solves the problem that automatic styleable property discovery
might be surprising for developers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20231207/eb284b79/attachment-0001.htm>
More information about the openjfx-dev
mailing list