public class ConfigurationWrapper extends Object implements Configuration
Modifier and Type | Field and Description |
---|---|
protected Map<Class<?>,Map<Class<?>,Integer>> |
localClassContracts |
Constructor and Description |
---|
ConfigurationWrapper(Configuration delegate) |
Modifier and Type | Method and Description |
---|---|
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. |
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. |
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.
|
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 |
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. |
void |
registerLocalContract(Class<?> provider,
Map<Class<?>,Integer> contracts) |
public ConfigurationWrapper(Configuration delegate)
public RuntimeType getRuntimeType()
Configuration
getRuntimeType
in interface Configuration
public Map<String,Object> getProperties()
Configuration
getProperties
in interface Configuration
public Object getProperty(String name)
Configuration
getProperty
in interface Configuration
name
- property name.null
if the property with such name is not configured.public Collection<String> getPropertyNames()
Configuration
collection
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 Configuration
collection
of property names.Configuration.getProperty(java.lang.String)
public boolean isEnabled(Feature feature)
Configuration
feature
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 Configuration
feature
- 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)
Configuration
feature
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 Configuration
featureClass
- 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)
Configuration
component
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 Configuration
component
- 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)
Configuration
componentClass
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 Configuration
componentClass
- 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)
Configuration
Map
. Method does not return null
.getContracts
in interface Configuration
public Set<Class<?>> getClasses()
Configuration
feature
) 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 Configuration
null
.Configuration.getInstances()
public Set<Object> getInstances()
Configuration
feature
) 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 Configuration
null
.Configuration.getClasses()
Copyright © 2019 JBoss by Red Hat. All rights reserved.