org.jsxp.framework
Class ElementTemplate<ElementType extends Element>

java.lang.Object
  extended by org.jsxp.framework.ElementTemplate<ElementType>

public class ElementTemplate<ElementType extends Element>
extends java.lang.Object

The Class ElementTemplate. Use this class to create a template for a jsxp element. This way you can use a jsxp element as a prototype and clone it. E.g. you can create lists by using an element to define how a row in the list should look like.


Constructor Summary
ElementTemplate(ElementType element, java.lang.Class<? extends Element> interfaceType, java.lang.String idPrefix)
          Instantiates a new element template.
 
Method Summary
 ElementType createElement()
          Creates the element.
 ElementType createElement(java.lang.Object bean)
          Creates the element.
 void disable(Element element)
          Disable a subelement for the next calls of a createElement-method.
 void disableOnce(Element element)
          Disable a subelement once for the next call of a createElement-method.
 void enable(Element element)
          Enable a subelement that you have disabled earlier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementTemplate

public ElementTemplate(ElementType element,
                       java.lang.Class<? extends Element> interfaceType,
                       java.lang.String idPrefix)
Instantiates a new element template.

Parameters:
element - the element
interfaceType - the interface type
idPrefix - the id prefix
Method Detail

createElement

public ElementType createElement()
Creates the element.

Returns:
the element type

createElement

public ElementType createElement(java.lang.Object bean)
Creates the element.

Parameters:
bean - the parameter bean to fill the element variables with values from the get-methods of the bean.
Returns:
the element type

disable

public void disable(Element element)
Disable a subelement for the next calls of a createElement-method. The created element won�t have this subelement as child.

Parameters:
element - the element

disableOnce

public void disableOnce(Element element)
Disable a subelement once for the next call of a createElement-method. The created element won�t have this subelement as child.

Parameters:
element - the element

enable

public void enable(Element element)
Enable a subelement that you have disabled earlier.

Parameters:
element - the element


Copyright © 2012 Oliver Szymanski & David Tanzer