Class SystemPropertiesConfigurationModel
java.lang.Object
org.glassfish.jersey.internal.config.SystemPropertiesConfigurationModel
- All Implemented Interfaces:
Configuration
,ExtendedConfig
,ExternalConfigurationModel<Void>
public class SystemPropertiesConfigurationModel
extends Object
implements ExternalConfigurationModel<Void>
The External Configuration Model that supports
System
properties. The properties are listed in a property class
in a form of public static final String
property name. The String
value of the property name is searched
among the System
properties. The property scan is performed only when
CommonProperties.ALLOW_SYSTEM_PROPERTIES_PROVIDER
is set to true
.-
Constructor Summary
ConstructorDescriptionSystemPropertiesConfigurationModel
(List<String> propertyClassNames) Create newExternalConfigurationModel
for properties defined by classes inpropertyClassNames
list. -
Method Summary
Modifier and TypeMethodDescription<T> T
Get value of a property as a definite type property shall exist in order for this method to be used.Obtain config objectgetContracts
(Class<?> componentClass) <T> Optional<T>
getOptionalProperty
(String name, Class<T> clazz) Get value of a property as a definite type property may not exist, an empty Optional object is returned in case of an empty propertygetProperty
(String name) boolean
boolean
boolean
isProperty
(String name) Get the value of the property with a given name converted toboolean
.boolean
isRegistered
(Class<?> componentClass) boolean
isRegistered
(Object component) mergeProperties
(Map<String, Object> inputProperties) Merge properties from other (found) external configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.ws.rs.core.Configuration
hasProperty
-
Constructor Details
-
SystemPropertiesConfigurationModel
Create newExternalConfigurationModel
for properties defined by classes inpropertyClassNames
list.- Parameters:
propertyClassNames
- List of property defining class names.
-
-
Method Details
-
getPropertyClassNames
-
as
Description copied from interface:ExternalConfigurationModel
Get value of a property as a definite type property shall exist in order for this method to be used. Otherwise exception is thrown- Specified by:
as
in interfaceExternalConfigurationModel<Void>
- Type Parameters:
T
- type of an expected value- Parameters:
name
- property nameclazz
- class type of an expected value- Returns:
- value of an expected type
-
getOptionalProperty
Description copied from interface:ExternalConfigurationModel
Get value of a property as a definite type property may not exist, an empty Optional object is returned in case of an empty property- Specified by:
getOptionalProperty
in interfaceExternalConfigurationModel<Void>
- Type Parameters:
T
- type of an expected value- Parameters:
name
- property nameclazz
- class type of an expected value- Returns:
- Optional object filled by a value of an expected type or by the NULL value (
-
mergeProperties
Description copied from interface:ExternalConfigurationModel
Merge properties from other (found) external configuration.- Specified by:
mergeProperties
in interfaceExternalConfigurationModel<Void>
- Parameters:
inputProperties
- those properties will be merged into ours- Returns:
- current instance of the model
-
getConfig
Description copied from interface:ExternalConfigurationModel
Obtain config object- Specified by:
getConfig
in interfaceExternalConfigurationModel<Void>
- Returns:
- external config provider
-
isProperty
Description copied from interface:ExtendedConfig
Get the value of the property with a given name converted toboolean
. Returnsfalse
if the value is not convertible.- Specified by:
isProperty
in interfaceExtendedConfig
- Parameters:
name
- property name.- Returns:
boolean
property value orfalse
if the property is not convertible.
-
getRuntimeType
- Specified by:
getRuntimeType
in interfaceConfiguration
-
getProperties
- Specified by:
getProperties
in interfaceConfiguration
-
getProperty
- Specified by:
getProperty
in interfaceConfiguration
-
getPropertyNames
- Specified by:
getPropertyNames
in interfaceConfiguration
-
isEnabled
- Specified by:
isEnabled
in interfaceConfiguration
-
isEnabled
- Specified by:
isEnabled
in interfaceConfiguration
-
isRegistered
- Specified by:
isRegistered
in interfaceConfiguration
-
isRegistered
- Specified by:
isRegistered
in interfaceConfiguration
-
getContracts
- Specified by:
getContracts
in interfaceConfiguration
-
getClasses
- Specified by:
getClasses
in interfaceConfiguration
-
getInstances
- Specified by:
getInstances
in interfaceConfiguration
-