com.vaadin.flow.server.
Class AbstractPropertyConfiguration
- java.lang.Object
-
- com.vaadin.flow.server.AbstractPropertyConfiguration
-
All Implemented Interfaces:
Direct Known Subclasses:
AbstractDeploymentConfiguration
,DefaultApplicationConfigurationFactory.ApplicationConfigurationImpl
public abstract class AbstractPropertyConfiguration extends Object implements AbstractConfiguration
Provides a configuration based on string properties.
Since:
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor Description AbstractPropertyConfiguration(Map<String,String> properties)
Creates a new instance with given
properties
.
-
Method Summary
All Methods Modifier and Type Method Description <T> T
getApplicationOrSystemProperty(String propertyName, T defaultValue, Function<String,T> converter)
Gets a configured property.
String
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.
protected Map<String,String>
getProperties()
Gets unmodifiable underlying properties.
String
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
enableDevServer, getBuildFolder, getFlowResourcesFolder, getJavaResourceFolder, isGlobalPnpm, isPnpmEnabled, isProductionMode, isUsageStatisticsEnabled, isXsrfProtectionEnabled, reuseDevServer, useV14Bootstrap
-
-
-
-
Method Detail
-
getStringProperty
public String getStringProperty(String name, String defaultValue)
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
public boolean getBooleanProperty(String name, boolean defaultValue)
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
public String getApplicationProperty(String parameterName)
Gets an application property value.
Parameters:
parameterName
- the Name or the parameter.Returns:
String value or null if not found
-
getProperties
protected Map<String,String> 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
protected String getSystemProperty(String parameterName)
Gets an system property value.
Parameters:
parameterName
- the Name or the parameter.Returns:
String value or null if not found
-
getApplicationProperty
protected String getApplicationProperty(Function<String,String> valueProvider, String propertyName)
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
-
-