org.writersforge.catalan.process.properties
Class XmlPropertyManager

java.lang.Object
  extended byorg.writersforge.catalan.process.properties.XmlPropertyManager

public class XmlPropertyManager
extends java.lang.Object

Utility class for converting XML data into the proper Java objects.

Author:
jsheets

Constructor Summary
XmlPropertyManager()
           
 
Method Summary
 void loadPropertyFile(java.lang.String propFile, java.util.Map properties)
          Loads all properties from the given property file into the given Map.
 void loadXmlAttributes(org.writersforge.bellows.Datum xml, java.util.Map properties)
          Loads all XML attributes into the given Map.
 void loadXmlContents(org.writersforge.bellows.Datum xml, java.util.List nodes)
          Loads all child nodes that match the given Bellows query path into the given Map.
 void loadXmlContents(org.writersforge.bellows.Datum xml, java.lang.String name, java.util.Map properties)
          Loads all XML attributes and all child nodes that match the given Bellows query path into the given Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlPropertyManager

public XmlPropertyManager()
Method Detail

loadXmlAttributes

public void loadXmlAttributes(org.writersforge.bellows.Datum xml,
                              java.util.Map properties)
Loads all XML attributes into the given Map.

Parameters:
xml - source XML data
properties - Map to load properties into

loadXmlContents

public void loadXmlContents(org.writersforge.bellows.Datum xml,
                            java.util.List nodes)
Loads all child nodes that match the given Bellows query path into the given Map.

Parameters:
xml - source XML data
nodes - List to load nodes into

loadXmlContents

public void loadXmlContents(org.writersforge.bellows.Datum xml,
                            java.lang.String name,
                            java.util.Map properties)
Loads all XML attributes and all child nodes that match the given Bellows query path into the given Map. Uses the name parameter to determine which XML attribute to search for each property's Map key.

Parameters:
xml - source XML data
name - the attribute name for Map keys
properties - Map to load properties into

loadPropertyFile

public void loadPropertyFile(java.lang.String propFile,
                             java.util.Map properties)
Loads all properties from the given property file into the given Map.

Parameters:
propFile - properties file relative to classpath
properties - Map to load properties into