public class SystemPropertiesConfigurationModel extends Object implements ExternalConfigurationModel<Void>
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 and Description |
|---|
SystemPropertiesConfigurationModel(List<String> propertyClassNames)
Create new
ExternalConfigurationModel for properties defined by classes in propertyClassNames list. |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
as(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()
Get the immutable set of registered component (such as provider or
feature) classes to be instantiated, injected and utilized in the scope
of the configurable instance. |
Void |
getConfig()
Obtain config object
|
Map<Class<?>,Integer> |
getContracts(Class<?> componentClass)
Get the extension contract registration information for a component of a given class.
|
Set<Object> |
getInstances()
Get the immutable set of registered component (such as provider or
feature) instances to be utilized by the configurable instance. |
<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 property
|
Map<String,Object> |
getProperties()
Get the immutable bag of configuration properties.
|
Object |
getProperty(String name)
Get the value for the property with a given name.
|
protected List<String> |
getPropertyClassNames() |
Collection<String> |
getPropertyNames()
Returns an immutable
collection containing the
property names available within the context of the current configuration instance. |
RuntimeType |
getRuntimeType()
Get the runtime type of this configuration context.
|
boolean |
isEnabled(Class<? extends Feature> featureClass)
Check if a
feature instance of featureClass class has been
previously enabled in the runtime configuration context. |
boolean |
isEnabled(Feature feature)
Check if a particular
feature instance has been previously
enabled in the runtime configuration context. |
boolean |
isProperty(String name)
Get the value of the property with a given name converted to
boolean. |
boolean |
isRegistered(Class<?> componentClass)
Check if a component of the supplied
componentClass class has been previously
registered in the runtime configuration context. |
boolean |
isRegistered(Object component)
Check if a particular API
component instance (such as providers or
features) has been previously registered in the runtime configuration context. |
ExternalConfigurationModel |
mergeProperties(Map<String,Object> inputProperties)
Merge properties from other (found) external configuration.
|
public SystemPropertiesConfigurationModel(List<String> propertyClassNames)
ExternalConfigurationModel for properties defined by classes in propertyClassNames list.propertyClassNames - List of property defining class names.public <T> T as(String name, Class<T> clazz)
ExternalConfigurationModelas in interface ExternalConfigurationModel<Void>T - type of an expected valuename - property nameclazz - class type of an expected valuepublic <T> Optional<T> getOptionalProperty(String name, Class<T> clazz)
ExternalConfigurationModelgetOptionalProperty in interface ExternalConfigurationModel<Void>T - type of an expected valuename - property nameclazz - class type of an expected valuepublic ExternalConfigurationModel mergeProperties(Map<String,Object> inputProperties)
ExternalConfigurationModelmergeProperties in interface ExternalConfigurationModel<Void>inputProperties - those properties will be merged into ourspublic Void getConfig()
ExternalConfigurationModelgetConfig in interface ExternalConfigurationModel<Void>public boolean isProperty(String name)
ExtendedConfigboolean.
Returns false if the value is not convertible.isProperty in interface ExtendedConfigname - property name.boolean property value or false if the property is not
convertible.public RuntimeType getRuntimeType()
ConfigurationgetRuntimeType in interface Configurationpublic Map<String,Object> getProperties()
ConfigurationgetProperties in interface Configurationpublic Object getProperty(String name)
ConfigurationgetProperty in interface Configurationname - property name.null
if the property with such name is not configured.public Collection<String> getPropertyNames()
Configurationcollection containing the
property names available within the context of the current configuration instance.
Use the Configuration.getProperty(java.lang.String) method with a property name to get the value of
a property.
getPropertyNames in interface Configurationcollection of property names.Configuration.getProperty(java.lang.String)public boolean isEnabled(Feature feature)
Configurationfeature instance has been previously
enabled in the runtime configuration context.
Method returns true only in case an instance equal to the feature
instance is already present among the features previously successfully enabled in
the configuration context.
isEnabled in interface Configurationfeature - a feature instance to test for.true if the feature instance has been previously enabled in this
configuration context, false otherwise.public boolean isEnabled(Class<? extends Feature> featureClass)
Configurationfeature instance of featureClass class has been
previously enabled in the runtime configuration context.
Method returns true in case any instance of the featureClass class is
already present among the features previously successfully enabled in the configuration
context.
isEnabled in interface ConfigurationfeatureClass - a feature class to test for.true if a feature of a given class has been previously enabled in this
configuration context, false otherwise.public boolean isRegistered(Object component)
Configurationcomponent instance (such as providers or
features) has been previously registered in the runtime configuration context.
Method returns true only in case an instance equal to the component
instance is already present among the components previously registered in the configuration
context.
isRegistered in interface Configurationcomponent - a component instance to test for.true if the component instance has been previously registered in this
configuration context, false otherwise.Configuration.isEnabled(Feature)public boolean isRegistered(Class<?> componentClass)
ConfigurationcomponentClass class has been previously
registered in the runtime configuration context.
Method returns true in case a component of the supplied componentClass class
is already present among the previously registered component classes or instances
in the configuration context.
isRegistered in interface ConfigurationcomponentClass - a component class to test for.true if a component of a given class has been previously registered in this
configuration context, false otherwise.Configuration.isEnabled(Class)public Map<Class<?>,Integer> getContracts(Class<?> componentClass)
ConfigurationMap. Method does not return null.getContracts in interface Configurationpublic Set<Class<?>> getClasses()
Configurationfeature) classes to be instantiated, injected and utilized in the scope
of the configurable instance.
For each component type, there can be only a single class-based or instance-based registration present in the configuration context at any given time.
getClasses in interface Configurationnull.Configuration.getInstances()public Set<Object> getInstances()
Configurationfeature) instances to be utilized by the configurable instance.
Fields and properties of returned instances are injected with their declared dependencies
(see Context) by the runtime prior to use.
For each component type, there can be only a single class-based or instance-based registration present in the configuration context at any given time.
getInstances in interface Configurationnull.Configuration.getClasses()Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.