类 ConfigurationServiceImpl
- java.lang.Object
-
- org.hibernate.engine.config.internal.ConfigurationServiceImpl
-
public class ConfigurationServiceImpl extends Object implements ConfigurationService, ServiceRegistryAwareService
The standard ConfigurationService implementation- 作者:
- Steve Ebersole
- 另请参阅:
- 序列化表格
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 org.hibernate.engine.config.spi.ConfigurationService
ConfigurationService.Converter<T>
-
-
构造器概要
构造器 构造器 说明 ConfigurationServiceImpl(Map settings)Constructs a ConfigurationServiceImpl
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 <T> Tcast(Class<T> expected, Object candidate)Cast candidate to the instance of expected type.<T> TgetSetting(String name, Class<T> expected, T defaultValue)Get the named setting.<T> TgetSetting(String name, ConfigurationService.Converter<T> converter)Get the named setting, using the specified converter.<T> TgetSetting(String name, ConfigurationService.Converter<T> converter, T defaultValue)Get the named setting, using the specified converter and default value.MapgetSettings()Access to the complete map of config settings.voidinjectServices(ServiceRegistryImplementor serviceRegistry)Callback to inject the registry.
-
-
-
构造器详细资料
-
ConfigurationServiceImpl
public ConfigurationServiceImpl(Map settings)
Constructs a ConfigurationServiceImpl- 参数:
settings- The map of settings
-
-
方法详细资料
-
getSettings
public Map getSettings()
从接口复制的说明:ConfigurationServiceAccess to the complete map of config settings. The returned map is immutable- 指定者:
getSettings在接口中ConfigurationService- 返回:
- The immutable map of config settings.
-
injectServices
public void injectServices(ServiceRegistryImplementor serviceRegistry)
从接口复制的说明:ServiceRegistryAwareServiceCallback to inject the registry.- 指定者:
injectServices在接口中ServiceRegistryAwareService- 参数:
serviceRegistry- The registry
-
getSetting
public <T> T getSetting(String name, ConfigurationService.Converter<T> converter)
从接口复制的说明:ConfigurationServiceGet the named setting, using the specified converter.- 指定者:
getSetting在接口中ConfigurationService- 类型参数:
T- The Java type of the conversion- 参数:
name- The name of the setting to get.converter- The converter to apply- 返回:
- The converted (typed) setting. May return
null(seeConfigurationService.getSetting(String, Class, Object))
-
getSetting
public <T> T getSetting(String name, ConfigurationService.Converter<T> converter, T defaultValue)
从接口复制的说明:ConfigurationServiceGet the named setting, using the specified converter and default value.- 指定者:
getSetting在接口中ConfigurationService- 类型参数:
T- The Java type of the conversion- 参数:
name- The name of the setting to get.converter- The converter to applydefaultValue- If no setting with that name is found, return this default value as the result.- 返回:
- The converted (typed) setting. Will be the defaultValue if no such setting was defined.
-
getSetting
public <T> T getSetting(String name, Class<T> expected, T defaultValue)
从接口复制的说明:ConfigurationServiceGet the named setting. Differs from the form taking a Converter in that here we expect to have a simple cast rather than any involved conversion.- 指定者:
getSetting在接口中ConfigurationService- 类型参数:
T- The Java type of the conversion- 参数:
name- The name of the setting to get.expected- The expected Java type.defaultValue- If no setting with that name is found, return this default value as the result.- 返回:
- The converted (typed) setting. Will be the defaultValue if no such setting was defined.
-
cast
public <T> T cast(Class<T> expected, Object candidate)
从接口复制的说明:ConfigurationServiceCast candidate to the instance of expected type.- 指定者:
cast在接口中ConfigurationService- 类型参数:
T- The java type of the expected return- 参数:
expected- The type of instance expected to return.candidate- The candidate object to be casted.- 返回:
- The instance of expected type or null if this cast fail.
-
-