SpringPropertyModelHandler Class — spring-boot Architecture
Architecture documentation for the SpringPropertyModelHandler class in SpringPropertyModelHandler.java from the spring-boot codebase.
Entity Profile
Source Code
core/spring-boot/src/main/java/org/springframework/boot/logging/logback/SpringPropertyModelHandler.java lines 43–73
class SpringPropertyModelHandler extends ModelHandlerBase {
private final @Nullable Environment environment;
SpringPropertyModelHandler(Context context, @Nullable Environment environment) {
super(context);
this.environment = environment;
}
@Override
public void handle(ModelInterpretationContext intercon, Model model) throws ModelHandlerException {
SpringPropertyModel propertyModel = (SpringPropertyModel) model;
Scope scope = ActionUtil.stringToScope(propertyModel.getScope());
String defaultValue = propertyModel.getDefaultValue();
String source = propertyModel.getSource();
if (OptionHelper.isNullOrEmpty(propertyModel.getName()) || OptionHelper.isNullOrEmpty(source)) {
addError("The \"name\" and \"source\" attributes of <springProperty> must be set");
}
PropertyModelHandlerHelper.setProperty(intercon, propertyModel.getName(), getValue(source, defaultValue),
scope);
}
private String getValue(String source, String defaultValue) {
if (this.environment == null) {
addWarn("No Spring Environment available to resolve " + source);
return defaultValue;
}
return this.environment.getProperty(source, defaultValue);
}
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free