rdonkin 01/09/22 08:23:44
Added: generation/xhtml-gen/templates ElementTemplate.vm.java
Log:
Generation tools initial commit
Revision Changes Path
1.1
jakarta-ecs2/generation/xhtml-gen/templates/ElementTemplate.vm.java
Index: ElementTemplate.vm.java
===================================================================
#*
ElementTemplate:
This is a template for an example ecs element.
It more a an example to demonstrate capabilities rather than a serious attempt to
come up with
a template for actual generation.
*# $license
package $package;
import org.apache.ecs.Element;
/**
* <p> This represents a <${element.Name}> element.
* This is a lovely fresh spring clean build.
*
* @author <a href="http://jakarta.apache.org/velocity">Texen</a>
*/
public class $Element extends XhtmlElement implements org.apache.ecs.Printable
{
public pElement element = new pElement();
// --------------------------------------
// INITIALIZER
// ---------------------------------------
/**
* Private initialization routine.
*/
{
setElementName("${element.Name}");
}
// --------------------------------------
// CONSTRUCTOR
// ---------------------------------------
public $Element()
{
}
public $Element(String element)
{
addElement(element);
}
public $Element(Element element)
{
addElement(element);
}
// --------------------------------------
// METHODS
// ---------------------------------------
#foreach ($attribute in $element.Attributes)
#set ( $Attribute = $codehelper.convertToName( ${attribute.Name}))
#if ($Attribute =="Filter") #set ( $Attribute = "FilterAttr") #end
#if ($Attribute =="Clazz") #set ( $Attribute = "ClassName") #end
/**
* <p> Get $Attribute.
* <p> Corresponds to the <code>${attribute.Name}</code> xml attribute.
*/
public String get$Attribute()
{
return getAttribute("${attribute.Name}");
}
#set ($AttrVariable = $codehelper.lowercaseFirstLetter($Attribute))
#if ($AttrVariable =="char") #set ( $AttrVariable = "value") #end
#if ($AttrVariable =="for") #set ( $AttrVariable = "value") #end
/**
* <p> Set $Attribute.
* <p> Corresponds to the <code>${attribute.Name}</code> xml attribute.
*/
public void set$Attribute(String $AttrVariable)
{
setAttribute("${attribute.Name}",$AttrVariable);
}
#end
public class pElement {
public $Element add(Element element)
{
addElement(element);
return ${Element}.this;
}
public $Element add(String element)
{
addElement(element);
return ${Element}.this;
}
#foreach ($attribute in $element.Attributes)
#set ( $Attribute = $codehelper.convertToName( ${attribute.Name}))
#if ($Attribute =="Filter") #set ( $Attribute = "FilterAttr") #end
#if ($Attribute =="Clazz") #set ( $Attribute = "ClassName") #end
/**
* <p> Get $Attribute.
* <p> Corresponds to the <code>${attribute.Name}</code> xml attribute.
*/
public String get$Attribute()
{
return getAttribute("${attribute.Name}");
}
#set ($AttrVariable = $strings.lowercaseFirstLetter($Attribute))
#if ($AttrVariable =="char") #set ( $AttrVariable = "value") #end
#if ($AttrVariable =="for") #set ( $AttrVariable = "value") #end
/**
* <p> Set $Attribute.
* <p> Corresponds to the <code>${attribute.Name}</code> xml attribute.
*/
public $Element set$Attribute(String $AttrVariable)
{
${Element}.this.set$Attribute($AttrVariable);
return ${Element}.this;
}
#end
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]