Return-Path: Delivered-To: apmail-jakarta-ecs-dev-archive@jakarta.apache.org Received: (qmail 17066 invoked by uid 500); 22 Sep 2001 15:30:45 -0000 Mailing-List: contact ecs-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: ecs-dev@jakarta.apache.org Delivered-To: mailing list ecs-dev@jakarta.apache.org Received: (qmail 17055 invoked by uid 500); 22 Sep 2001 15:30:45 -0000 Delivered-To: apmail-jakarta-ecs-cvs@jakarta.apache.org Delivered-To: apmail-jakarta-ecs2-cvs@apache.org Date: 22 Sep 2001 15:23:44 -0000 Message-ID: <20010922152344.34020.qmail@icarus.apache.org> From: rdonkin@apache.org To: jakarta-ecs2-cvs@apache.org Subject: cvs commit: jakarta-ecs2/generation/xhtml-gen/templates ElementTemplate.vm.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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; /** *

This represents a <${element.Name}> element. * This is a lovely fresh spring clean build. * * @author Texen */ 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 /** *

Get $Attribute. *

Corresponds to the ${attribute.Name} 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 /** *

Set $Attribute. *

Corresponds to the ${attribute.Name} 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 /** *

Get $Attribute. *

Corresponds to the ${attribute.Name} 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 /** *

Set $Attribute. *

Corresponds to the ${attribute.Name} xml attribute. */ public $Element set$Attribute(String $AttrVariable) { ${Element}.this.set$Attribute($AttrVariable); return ${Element}.this; } #end } } --------------------------------------------------------------------- To unsubscribe, e-mail: ecs-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: ecs-dev-help@jakarta.apache.org