com.vaadin.flow.server.
Class AbstractPropertyConfiguration
All Implemented Interfaces:
Direct Known Subclasses:
AbstractDeploymentConfiguration
, DefaultApplicationConfigurationFactory.ApplicationConfigurationImpl
Provides a configuration based on string properties.
Since:
Author:
Vaadin Ltd
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractPropertyConfiguration
(Map<String, String> properties) Creates a new instance with given
properties
. -
Method Summary
Modifier and TypeMethodDescription<T> T
getApplicationOrSystemProperty
(String propertyName, T defaultValue, Function<String, T> converter) Gets a configured property.
getApplicationProperty
(String parameterName) Gets an application property value.
protected String
getApplicationProperty
(Function<String, String> valueProvider, String propertyName) Gets application property value using the
valueProvider
.boolean
getBooleanProperty
(String name, boolean defaultValue) Gets a configured property as a boolean.
Gets unmodifiable underlying properties.
getStringProperty
(String name, String defaultValue) Gets a configured property as a string.
protected String
getSystemProperty
(String parameterName) Gets an system property value.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.server.AbstractConfiguration
frontendHotdeploy, getBuildFolder, getFrontendFolder, getJavaResourceFolder, getJavaSourceFolder, getMode, getProjectFolder, isBunEnabled, isGlobalPnpm, isPnpmEnabled, isProductionMode, isUsageStatisticsEnabled, isXsrfProtectionEnabled, reuseDevServer
-
Constructor Details
-
AbstractPropertyConfiguration
Creates a new instance with given
properties
.Parameters:
properties
- configuration properties
-
-
Method Details
-
getStringProperty
Description copied from interface:
AbstractConfiguration
Gets a configured property as a string.
Specified by:
getStringProperty
in interfaceAbstractConfiguration
Parameters:
name
- The simple of the property, in some contexts, lookup might be performed using variations of the provided name.defaultValue
- the default value that should be used if no value has been definedReturns:
the property value, or the passed default value if no property value is found
-
getBooleanProperty
Description copied from interface:
AbstractConfiguration
Gets a configured property as a boolean.
Specified by:
getBooleanProperty
in interfaceAbstractConfiguration
Parameters:
name
- The simple of the property, in some contexts, lookup might be performed using variations of the provided name.defaultValue
- the default value that should be used if no value has been definedReturns:
the property value, or the passed default value if no property value is found
-
getApplicationProperty
Gets an application property value.
Parameters:
parameterName
- the Name or the parameter.Returns:
String value or null if not found
-
getProperties
Gets unmodifiable underlying properties.
Returns:
the properties map
-
getApplicationOrSystemProperty
public <T> T getApplicationOrSystemProperty(String propertyName, T defaultValue, Function<String, T> converter) Gets a configured property. The properties are typically read from e.g. web.xml or from system properties of the JVM.
Type Parameters:
T
- type of a propertyParameters:
propertyName
- The simple of the property, in some contexts, lookup might be performed using variations of the provided name.defaultValue
- the default value that should be used if no value has been definedconverter
- the way string should be converted into the required propertyReturns:
the property value, or the passed default value if no property value is found
-
getSystemProperty
Gets an system property value.
Parameters:
parameterName
- the Name or the parameter.Returns:
String value or null if not found
-
getApplicationProperty
Gets application property value using the
valueProvider
.Parameters:
valueProvider
- a value provider for the propertypropertyName
- the name or the parameter.Returns:
String value or null if not found
-