-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document purpose of name
attribute in @PropertySource
#30195
Comments
hi @manueljordan, This will provide more clarity for the name attribute of the
@Autowired
Environment env;
MutablePropertySources sources = ((ConfigurableEnvironment)env).getPropertySources();
PropertySource<?> propertySource = sources.get("infra");
Object property = propertySource.getProperty("name.value");
System.out.println(property); |
name
attribute in @PropertySource
To summarize what's been stated on Stack Overflow and above by @anii1827... The name of a
Note that this issue has been assigned the |
hi @sbrannen |
Thanks to both the valuable feedback. Now has more sense. |
Hi @anii1827,
That's very kind of you to offer! Unfortunately, I had already started on this issue (see 49a4ed2), and I drafted the text I plan to include in #30195 (comment). In light of that, it's easier if I keep this issue assigned to me. Cheers, Sam |
Sam, just being curious your point (2) is already explained by the valuable comment of anii1827 - but could you pls add a simple snipet code about your point (1)? I want understand very well that point - If I understand correctly, if exists the |
@manueljordan, core Spring Framework does not provide any direct mechanism for linking a specific property to a Rather, that's a feature of Spring Boot: Spring Boot uses its |
In Spring Framework, for the
@PropertySource
, according with its API or javadoc it has the name attributeOk, is clear that is possible define the name such as:
But How and where use that name? What is its purpose?
It was reported at SO at:
The comment is valid, but would be nice if can be expanded at both Spring Reference documentation and javadoc
The text was updated successfully, but these errors were encountered: