org.infolayer.templates
Class TemplateElement

java.lang.Object
  extended byorg.kxml2.kdom.Element
      extended byorg.infolayer.templates.TemplateElement
Direct Known Subclasses:
org.infolayer.templates.html.AbstractButton, ParameterizedElement, TE_assign, TE_attribute, TE_banner, TE_case, TE_chart, TE_chartdata, TE_choose, TE_clone, TE_column, TE_comment, TE_context, TE_control, TE_create, TE_download, TE_edit, TE_element, TE_else, TE_exec, TE_forAll, TE_form, TE_if, TE_image, TE_inner, TE_iterate, TE_link, TE_login, TE_messages, TE_operation, TE_operations, TE_otherwise, TE_properties, TE_properties, TE_property, TE_property, TE_query, TE_recurse, TE_recursion, TE_statemachine, TE_switch, TE_table, TE_text, TE_tree, TE_urlParam, TE_valueOf, TE_variable, TE_when, TE_withParam

public class TemplateElement
extends org.kxml2.kdom.Element

A default template element, including support for evaluated attributes

See Also:
Serialized Form

Constructor Summary
TemplateElement()
           
 
Method Summary
 void apply(XmlSerializer xw, IlRequest context, Bindings bindings)
          Applies the template mechanism.
 void applyChildren(XmlSerializer xw, IlRequest context, Bindings bindings)
          Applies the template mechanism to all child elements.
 void assertNoChildren()
           
 void assertNoChildren(java.lang.String msg)
           
 java.lang.String getAttributeValue(java.lang.String namespace, java.lang.String name, Bindings bindings)
          like getAttributeValue/2, but if the given attribute is in the template namespace, its evaluated value is returned
 VarDef getVarDefs()
          Returns the variable definitions valid at this position in the document
 void init()
           
 java.lang.String readTextContent(IlRequest request, Bindings bindings)
           
 void setVarDefs(VarDef def)
           
 void writeAttributes(XmlSerializer xw, IlRequest request, Bindings bindings, java.lang.String[] omit)
          Writes the attributes, where attributes in the template namespace are treated as ocl expressions and evaluated in the current context
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateElement

public TemplateElement()
Method Detail

init

public void init()

getVarDefs

public final VarDef getVarDefs()
Returns the variable definitions valid at this position in the document


getAttributeValue

public java.lang.String getAttributeValue(java.lang.String namespace,
                                          java.lang.String name,
                                          Bindings bindings)
like getAttributeValue/2, but if the given attribute is in the template namespace, its evaluated value is returned


setVarDefs

public void setVarDefs(VarDef def)
Parameters:
def -

writeAttributes

public void writeAttributes(XmlSerializer xw,
                            IlRequest request,
                            Bindings bindings,
                            java.lang.String[] omit)
                     throws java.io.IOException
Writes the attributes, where attributes in the template namespace are treated as ocl expressions and evaluated in the current context

Throws:
java.io.IOException

apply

public void apply(XmlSerializer xw,
                  IlRequest context,
                  Bindings bindings)
           throws java.io.IOException
Applies the template mechanism. Must be overwritten in the

Throws:
java.io.IOException

applyChildren

public void applyChildren(XmlSerializer xw,
                          IlRequest context,
                          Bindings bindings)
                   throws java.io.IOException
Applies the template mechanism to all child elements. Text children are written without transformation

Throws:
java.io.IOException

readTextContent

public java.lang.String readTextContent(IlRequest request,
                                        Bindings bindings)
                                 throws java.lang.IllegalArgumentException,
                                        java.lang.IllegalStateException,
                                        java.io.IOException
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException
java.io.IOException

assertNoChildren

public void assertNoChildren()

assertNoChildren

public void assertNoChildren(java.lang.String msg)