MessagesBundleCondition class
A condition that matches when the message bundle exists, that is when
resources:<basename>.properties exists for one of the configured
basenames.
It keeps the auto-configured messageSource out of applications that
have no messages file. A starter that ships its own message-based bean
can reuse it:
@Bean()
@MessagesBundleCondition()
ErrorTexts errorTexts(MessageSource messages) => ErrorTexts(messages);
Spring (Java): Spring Boot's ResourceBundleCondition, internal to
MessageSourceAutoConfiguration.
- Implemented types
Constructors
- MessagesBundleCondition()
-
The condition; it reads
spring.messages.basenamewhen evaluated.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
matches(
ConditionContext context) → bool -
Whether the annotated bean should be registered;
contextgives access to the configuration and the definitions registered so far.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
basenames(
Environment environment) → List< String> -
The bundle basenames of
environment'sspring.messages.basename, as paths belowlib/resources/;['messages']when it is not set.