org.jmonks.batch.framework.util
Class FrameworkUtil

java.lang.Object
  extended byorg.jmonks.batch.framework.util.FrameworkUtil

public final class FrameworkUtil
extends java.lang.Object

FramworkUtil contains utility methods required by the framework.

Since:
1.0
Version:
1.0
Author:
Suresh Pragada

Method Summary
static void loadPropertiesFromElementToMap(org.w3c.dom.Element configElement, java.util.Map propertyMap)
           Loads the property elements exists in the given element to the given map.
static void loadPropertiesFromStringToMap(java.lang.String propertiesString, java.util.Map propertyMap)
           Loads the property key value pairs exists in the given string to the given map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadPropertiesFromElementToMap

public static void loadPropertiesFromElementToMap(org.w3c.dom.Element configElement,
                                                  java.util.Map propertyMap)

Loads the property elements exists in the given element to the given map. This looks for the <property> elements in the given element and looks for the value of "key" attribute and the values of <property> element and load them as key values pairs.

Property elements should be in the following format.

<property key="some-config-key1">some-config-value1</property>

Parameters:
configElement - DOM Element consists of <property> elements.
propertyMap - Map to be loaded with property key values.
Throws:
java.lang.IllegalArgumentException - If either configElement or propertyMap is null.

loadPropertiesFromStringToMap

public static void loadPropertiesFromStringToMap(java.lang.String propertiesString,
                                                 java.util.Map propertyMap)

Loads the property key value pairs exists in the given string to the given map. This looks for the properties in concantenated by ":" and each property in turn concatenated by "=".

Property elements should be in the following format.

key1=value1:key2=value2

Parameters:
propertiesString - String consists of properties.
propertyMap - Map to be loaded with property key values.
Throws:
java.lang.IllegalArgumentException - If either propertiesString or propertyMap is null.