Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

[feat] Support path expression for Key annotation #36

Open
syhily opened this issue Aug 21, 2020 · 2 comments
Open

[feat] Support path expression for Key annotation #36

syhily opened this issue Aug 21, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@syhily
Copy link
Contributor

syhily commented Aug 21, 2020

image

Support the path expression for @Key annotation like the picture above.

@keykey7
Copy link
Owner

keykey7 commented Aug 21, 2020

it has some drawbacks as it could conflict with another (nested) key. Otherwise it's definitely possible.
Depending on the usecase, this could also be an alternative (even though quite verbose):

interface B {
	@Default("${settings.dimension.filter-null-value}")
	boolean filterNullGrouping();
	S settings();
}
interface S {
	D dimension();
}
interface D {
	@Key("filter-null-value")
	boolean filterNullValue();
}

@keykey7 keykey7 added the enhancement New feature or request label Aug 21, 2020
@syhily
Copy link
Contributor Author

syhily commented Aug 25, 2020

How about introducing a new annotation called @Path. It wouldn't inherit the parent's definition, but just query the value from the given path.

interface A {
	B some();
	interface B {
		@Path("settings.dimension.filter-null-value")
		boolean filterNullGrouping();
	}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants