org.enhydra.barracuda.core.comp
Interface ElementFactory


public interface ElementFactory

This interface defines the methods needed to implement a ListModel.


Method Summary
 Node getDefaultElement()
          Get the default template element.
 Document getDocument()
          Get an actual reference to the Document so you can create whatever type of node you wish.
 Node getElement(String key)
          Get a template element for the key.
 List getElementKeys()
          Get a list of all the keys for a given template.
 

Method Detail

getDefaultElement

public Node getDefaultElement()
Get the default template element. Once you get the template, you should always do a cloneNode() on it and then modify the newly created copy. May return null if no suitable template is available.

Returns:
the default template node.

getElement

public Node getElement(String key)
Get a template element for the key. The key value may be a fully qualified class or interface name, or it may be the tag name that corresponds to that template. Once you get the template, you should always do a cloneNode() on it and then modify the copy. May return null if no suitable template is available.

Parameters:
key - the target key value
Returns:
the default template node.

getElementKeys

public List getElementKeys()
Get a list of all the keys for a given template.

Returns:
a list of all the keys for a given template.

getDocument

public Document getDocument()
Get an actual reference to the Document so you can create whatever type of node you wish. This is the least preferred approach to use for creating nodes from a TemplateFactory, because by using the Document to create nodes you will lose any additional markup (ie. color, font, emphasis, etc) contained in the template for this particular node.

Returns:
the owner document


Copyright © 2003 BarracudaMVC.org All Rights Reserved.