org.qi4j.api.composite
Class PropertyMapper

java.lang.Object
  extended by org.qi4j.api.composite.PropertyMapper

public final class PropertyMapper
extends Object

Transfer properties to Composite properties


Constructor Summary
PropertyMapper()
           
 
Method Summary
static Properties getProperties(Composite composite)
          Create Properties object which is backed by the given Composite.
static void map(InputStream propertyInputStream, Composite composite)
          Load a Properties object from the given stream, close it, and then populate the Composite with the properties.
static void map(Properties props, Composite composite)
          Populate the Composite with properties from the given properties object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyMapper

public PropertyMapper()
Method Detail

map

public static void map(Properties props,
                       Composite composite)
                throws IllegalArgumentException
Populate the Composite with properties from the given properties object.

Parameters:
props - properties object
composite - the composite instance
Throws:
IllegalArgumentException - if properties could not be transferred to composite

map

public static void map(InputStream propertyInputStream,
                       Composite composite)
                throws IOException
Load a Properties object from the given stream, close it, and then populate the Composite with the properties.

Parameters:
propertyInputStream - properties input stream
composite - the instance
Throws:
IOException - if the stream could not be read

getProperties

public static Properties getProperties(Composite composite)
Create Properties object which is backed by the given Composite.

Parameters:
composite - the instance
Returns:
properties instance