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 supportsSystemproperties. The properties are listed in a property class in a form ofpublic static final Stringproperty name. TheStringvalue of the property name is searched among theSystemproperties. The property scan is performed only whenCommonProperties.ALLOW_SYSTEM_PROPERTIES_PROVIDERis set totrue.
-
-
Constructor Summary
Constructors Constructor Description SystemPropertiesConfigurationModel(List<String> propertyClassNames)Create newExternalConfigurationModelfor properties defined by classes inpropertyClassNameslist.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tas(String name, Class<T> clazz)Get value of a property as a definite type property shall exist in order for this method to be used.Set<Class<?>>getClasses()VoidgetConfig()Obtain config objectMap<Class<?>,Integer>getContracts(Class<?> componentClass)Set<Object>getInstances()<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 propertyMap<String,Object>getProperties()ObjectgetProperty(String name)protected List<String>getPropertyClassNames()Collection<String>getPropertyNames()RuntimeTypegetRuntimeType()booleanisEnabled(Feature feature)booleanisEnabled(Class<? extends Feature> featureClass)booleanisProperty(String name)Get the value of the property with a given name converted toboolean.booleanisRegistered(Class<?> componentClass)booleanisRegistered(Object component)ExternalConfigurationModelmergeProperties(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 Detail
-
SystemPropertiesConfigurationModel
public SystemPropertiesConfigurationModel(List<String> propertyClassNames)
Create newExternalConfigurationModelfor properties defined by classes inpropertyClassNameslist.- Parameters:
propertyClassNames- List of property defining class names.
-
-
Method Detail
-
as
public <T> T as(String name, Class<T> clazz)
Description copied from interface:ExternalConfigurationModelGet 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:
asin 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
public <T> Optional<T> getOptionalProperty(String name, Class<T> clazz)
Description copied from interface:ExternalConfigurationModelGet 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:
getOptionalPropertyin 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
public ExternalConfigurationModel mergeProperties(Map<String,Object> inputProperties)
Description copied from interface:ExternalConfigurationModelMerge properties from other (found) external configuration.- Specified by:
mergePropertiesin interfaceExternalConfigurationModel<Void>- Parameters:
inputProperties- those properties will be merged into ours- Returns:
- current instance of the model
-
getConfig
public Void getConfig()
Description copied from interface:ExternalConfigurationModelObtain config object- Specified by:
getConfigin interfaceExternalConfigurationModel<Void>- Returns:
- external config provider
-
isProperty
public boolean isProperty(String name)
Description copied from interface:ExtendedConfigGet the value of the property with a given name converted toboolean. Returnsfalseif the value is not convertible.- Specified by:
isPropertyin interfaceExtendedConfig- Parameters:
name- property name.- Returns:
booleanproperty value orfalseif the property is not convertible.
-
getRuntimeType
public RuntimeType getRuntimeType()
- Specified by:
getRuntimeTypein interfaceConfiguration
-
getProperties
public Map<String,Object> getProperties()
- Specified by:
getPropertiesin interfaceConfiguration
-
getProperty
public Object getProperty(String name)
- Specified by:
getPropertyin interfaceConfiguration
-
getPropertyNames
public Collection<String> getPropertyNames()
- Specified by:
getPropertyNamesin interfaceConfiguration
-
isEnabled
public boolean isEnabled(Feature feature)
- Specified by:
isEnabledin interfaceConfiguration
-
isEnabled
public boolean isEnabled(Class<? extends Feature> featureClass)
- Specified by:
isEnabledin interfaceConfiguration
-
isRegistered
public boolean isRegistered(Object component)
- Specified by:
isRegisteredin interfaceConfiguration
-
isRegistered
public boolean isRegistered(Class<?> componentClass)
- Specified by:
isRegisteredin interfaceConfiguration
-
getContracts
public Map<Class<?>,Integer> getContracts(Class<?> componentClass)
- Specified by:
getContractsin interfaceConfiguration
-
getClasses
public Set<Class<?>> getClasses()
- Specified by:
getClassesin interfaceConfiguration
-
getInstances
public Set<Object> getInstances()
- Specified by:
getInstancesin interfaceConfiguration
-
-