Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Hibernate OGM, Domain model persistence for NoSQL datastores
  * License: GNU Lesser General Public License (LGPL), version 2.1 or later
  * See the lgpl.txt file in the root directory or <>.
 package org.hibernate.ogm.util.configurationreader.spi;
 import java.util.Map;
Provides a safe access to configuration values as typically configured via org.hibernate.ogm.cfg.OgmConfiguration or persistence.xml.

Values can be given in two ways:

  • as literal value e.g. a String, int, enum or These values can either be specified as instance of the target type or as String which can be converted into the target type (in case of URLs this string can either represent a class path element, an URL or a file system path).
  • as an implementation type of the target type. In this case, values can be specified in the following representations:
    • as instance of the expected target type
    • as java.lang.Class, representing a sub-type of the expected target type
    • as string, representing the FQN of a sub-type of the expected target type
    • as string, representing a short name as resolvable via a given ShortNameResolver
    If specified as class name, short name or class object, the specified type will be instantiated using its default constructor.

Gunnar Morling
	private final Map<?, ?> properties;
	public ConfigurationPropertyReader(Configuration configuration) {
		thisconfiguration.getProperties(), null );
	public ConfigurationPropertyReader(Map<?, ?> properties) {
		thispropertiesnull );
	public ConfigurationPropertyReader(Configuration configurationClassLoaderService classLoaderService) {
		thisconfiguration.getProperties(), classLoaderService );
	public ConfigurationPropertyReader(Map<?, ?> propertiesClassLoaderService classLoaderService) {
		this. = properties;
		this. = classLoaderService;

Returns a context for retrieving the specified property. The returned context allows to customize the value retrieval logic, e.g. by setting a default value or marking the property as required.

propertyName the name of the property to retrieve
targetType the target type of the property
<T> the type of the property
a context for retrieving the specified property
	public <T> PropertyReaderContext<T> property(String propertyNameClass<T> targetType) {
		return new SimplePropertyReaderContext<T>( propertyNametargetType );
New to GrepCode? Check out our FAQ X