Top Description Inners Methods
org.hibernate.engine.config.spi

public Interface ConfigurationService

extends Service
Known Direct Implementers
org.hibernate.engine.config.internal.ConfigurationServiceImpl
Imports
java.util.Map, org.hibernate.service.Service

Provides access to the initial user-provided configuration values. Generally speaking these values come from:
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ConfigurationService.Converter<
The Java type of the converted value
T
>

Simple conversion contract for converting an untyped object to a specified type.

Method Summary

Modifier and TypeMethod and Description
public <
The java type of the expected return
T
>
T

Returns:

The instance of expected type or null if this cast fail.
cast
(Class<T>
The type of instance expected to return.
expected
,
Object
The candidate object to be casted.
candidate
)

Deprecated No idea why this is exposed here...
Cast candidate to the instance of expected type.
public <
The Java type of the conversion
T
>
T

Returns:

The converted (typed) setting. May return null (see getSetting(String, Class, Object))
getSetting
(String
The name of the setting to get.
name
,
ConfigurationService.Converter<T>
The converter to apply
converter
)

Get the named setting, using the specified converter.

public <
The Java type of the conversion
T
>
T

Returns:

The converted (typed) setting. Will be the defaultValue if no such setting was defined.
getSetting
(String
The name of the setting to get.
name
,
ConfigurationService.Converter<T>
The converter to apply
converter
,
T
If no setting with that name is found, return this default value as the result.
defaultValue
)

Get the named setting, using the specified converter and default value.

public <
The Java type of the conversion
T
>
T

Returns:

The converted (typed) setting. Will be the defaultValue if no such setting was defined.
getSetting
(String
The name of the setting to get.
name
,
Class<T>
The expected Java type.
expected
,
T
If no setting with that name is found, return this default value as the result.
defaultValue
)

Get the named setting.

public Map<K, V>

Returns:

The immutable map of config settings.
getSettings
()

Access to the complete map of config settings.

Method Detail

castback to summary
public <T> T cast(Class<T> expected, Object candidate)

Deprecated

No idea why this is exposed here...

Cast candidate to the instance of expected type.

Parameters
<T>
The java type of the expected return
expected:Class<T>

The type of instance expected to return.

candidate:Object

The candidate object to be casted.

Returns:T

The instance of expected type or null if this cast fail.

Annotations
@Deprecated
getSettingback to summary
public <T> T getSetting(String name, ConfigurationService.Converter<T> converter)

Get the named setting, using the specified converter.

Parameters
<T>
The Java type of the conversion
name:String

The name of the setting to get.

converter:ConfigurationService.Converter<T>

The converter to apply

Returns:T

The converted (typed) setting. May return null (see getSetting(String, Class, Object))

getSettingback to summary
public <T> T getSetting(String name, ConfigurationService.Converter<T> converter, T defaultValue)

Get the named setting, using the specified converter and default value.

Parameters
<T>
The Java type of the conversion
name:String

The name of the setting to get.

converter:ConfigurationService.Converter<T>

The converter to apply

defaultValue:T

If no setting with that name is found, return this default value as the result.

Returns:T

The converted (typed) setting. Will be the defaultValue if no such setting was defined.

getSettingback to summary
public <T> T getSetting(String name, Class<T> expected, T defaultValue)

Get 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.

Parameters
<T>
The Java type of the conversion
name:String

The name of the setting to get.

expected:Class<T>

The expected Java type.

defaultValue:T

If no setting with that name is found, return this default value as the result.

Returns:T

The converted (typed) setting. Will be the defaultValue if no such setting was defined.

getSettingsback to summary
public Map<K, V> getSettings()

Access to the complete map of config settings. The returned map is immutable

Returns:Map<K, V>

The immutable map of config settings.

org.hibernate.engine.config.spi back to summary

public Interface ConfigurationService.Converter<T>

Type Parameters
<T>
The Java type of the converted value

Simple conversion contract for converting an untyped object to a specified type.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

The converted (typed) value.
convert
(Object
The untyped value
value
)

Convert an untyped Object reference to the Converter's type.

Method Detail

convertback to summary
public T convert(Object value)

Convert an untyped Object reference to the Converter's type.

Parameters
value:Object

The untyped value

Returns:T

The converted (typed) value.