org.qi4j.api.composite
Class PropertyMapper

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

public final class PropertyMapper
extends java.lang.Object

Transfer java.util.Properties to Composite properties


Constructor Summary
PropertyMapper()
           
 
Method Summary
static void map(java.io.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(java.util.Properties props, Composite composite)
          Populate the Composite with properties from the given properties object.
static java.util.Properties toJavaProperties(Composite composite)
          Create Properties object which is backed by the given Composite.
 
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(java.util.Properties props,
                       Composite composite)
                throws java.lang.IllegalArgumentException
Populate the Composite with properties from the given properties object.

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

map

public static void map(java.io.InputStream propertyInputStream,
                       Composite composite)
                throws java.io.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:
java.io.IOException - if the stream could not be read

toJavaProperties

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

Parameters:
composite - the instance
Returns:
properties instance