de.smartics.properties.spi.config.resolve
Class ConfigurationPropertiesResolveContext

Package class diagram package ConfigurationPropertiesResolveContext
java.lang.Object
  extended by de.smartics.properties.spi.config.resolve.ConfigurationPropertiesResolveContext
All Implemented Interfaces:
ResolveContext, Serializable

@ThreadSafe
public final class ConfigurationPropertiesResolveContext
     
     
extends Object
implements ResolveContext

Simple interface on ConfigurationProperties.

Implementation Notes:
the implementation is thread safe since it only provides read access to the wrapped configuration. If the configuration is accessed by other threads, it is not.
See Also:
Serialized Form

Constructor Summary
ConfigurationPropertiesResolveContext(PropertyDescriptorRegistry registry, ConfigurationProperties config)
          Default constructor.
 
Method Summary
 String get(String key)
          Returns the value for the given key.
 ConfigurationKey<?> getKey()
          Returns the unique identifier of the wrapped properties configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationPropertiesResolveContext

public ConfigurationPropertiesResolveContext(PropertyDescriptorRegistry registry,
                                             ConfigurationProperties config)
Default constructor.

Parameters:
registry - the registry to resolve property descriptors.
config - the configuration to adapt.
Method Detail

getKey

public ConfigurationKey<?> getKey()
Returns the unique identifier of the wrapped properties configuration.

Specified by:
getKey in interface ResolveContext
Returns:
the unique identifier of the wrapped properties configuration.
See Also:
ResolveContext.getKey()

get

public String get(String key)
           throws IllegalArgumentException,
                  UnknownPropertyException,
                  PropertyValidationException
Returns the value for the given key.

Specified by:
get in interface ResolveContext
Parameters:
key - the key to the requested value.
Returns:
the requested value or null if there is no value for that key (but the key is known).
Throws:
IllegalArgumentException - if key is blank.
UnknownPropertyException - if key is not known.
PropertyValidationException - if the property is invalid according to its constraints.
See Also:
ResolveContext.get(java.lang.String)


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.