com.googlecode.sarasvati.load
Interface NodeFactory
- All Known Implementing Classes:
- DefaultNodeFactory
public interface NodeFactory
newNode
Node newNode(String type)
throws SarasvatiLoadException
- Creates a new node of the given type
- Returns:
- The new node
- Throws:
SarasvatiLoadException
- If a node of the given type cannot be instantiated
loadCustom
Map<String,String> loadCustom(Node node,
Object custom)
throws SarasvatiLoadException
- Loads the custom data into the node. Returns a map of the data loaded, keyed
by bean property name. So if the the node has a property foo, which in turn
has a property bar, which was set to 1, then the map will contain an entry
foo.bar=1
This may be used to store the data for nodes of type CustomNode
.
- Parameters:
node
- The node to set the data incustom
- The custom data from the XML file
- Returns:
- A map of bean properties set. This may be used
if the node is a
CustomNode
- Throws:
SarasvatiLoadException
- If custom data is incorrect.