jakarta-ecs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-ecs2/generation/xhtml-gen/templates ElementTemplate.vm.java
Date Sat, 22 Sep 2001 15:23:44 GMT
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 &lt;${element.Name}&gt; 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: ecs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-dev-help@jakarta.apache.org


Mime
View raw message