de.smartics.properties.spi.config.proxy
Class PropertyConfigurationObjectBuilder

Package class diagram package PropertyConfigurationObjectBuilder
java.lang.Object
  extended by de.smartics.properties.spi.config.proxy.PropertyConfigurationObjectBuilder

public final class PropertyConfigurationObjectBuilder
     
     
extends Object

This factory creates a implementation object via a java dynamic proxy for a given properties interface. Using this object it is possible to access the properties and when defined in the given interface the keys and property descriptions can be accessed.


Constructor Summary
PropertyConfigurationObjectBuilder()
          Default constructor.
 
Method Summary
<T> T
build(Class<T> propertiesInterface, SerializableConfigurationProperties configurationProperties)
          Build the object that contains the properties information for the given properties interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyConfigurationObjectBuilder

public PropertyConfigurationObjectBuilder()
Default constructor.

Method Detail

build

public <T> T build(Class<T> propertiesInterface,
                   SerializableConfigurationProperties configurationProperties)
        throws NotAPropertySetAnnotatedInterfaceException
Build the object that contains the properties information for the given properties interface. The interface must be provided through its class object and has to have a PropertySet annotation.

Type Parameters:
T - to provide a type safe access to the properties the returned object implements the given properties interface.
Parameters:
propertiesInterface - the properties interface as class object with an PropertySet annotation.
configurationProperties - the configuration properties that shall be used to access the properties.
Returns:
the object that contains the properties information for the given properties interface.
Throws:
NotAPropertySetAnnotatedInterfaceException - when the given class does not represent an interface and this interface is not annotated with PropertySet or when null.


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