[jboss-cvs] jboss-seam/src/gen/org/jboss/seam/tool ...

Gavin King gavin.king at jboss.com
Mon Nov 6 17:18:21 EST 2006


  User: gavin   
  Date: 06/11/06 17:18:21

  Added:       src/gen/org/jboss/seam/tool   PrintTask.java
                        UppercasePropertyTask.java
  Log:
  don't drive it from the scripts, parameterize the datasource
  
  Revision  Changes    Path
  1.1      date: 2006/11/06 22:18:21;  author: gavin;  state: Exp;jboss-seam/src/gen/org/jboss/seam/tool/PrintTask.java
  
  Index: PrintTask.java
  ===================================================================
  package org.jboss.seam.tool;
  
  import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileReader;
  
  import org.apache.tools.ant.BuildException;
  import org.apache.tools.ant.Task;
  
  public class PrintTask extends Task
  {
     private String file;
  
     public void setFile(String file)
     {
        this.file = file;
     }
     
     @Override
     public void execute() throws BuildException
     {
        try
        {
           BufferedReader reader = new BufferedReader( new FileReader( new File(file) ) );
           while ( reader.ready() )
           {
              System.out.println( reader.readLine() );
           }
        }
        catch (Exception e)
        {
           throw new BuildException(e);
        }
     }
  }
  
  
  
  1.1      date: 2006/11/06 22:18:21;  author: gavin;  state: Exp;jboss-seam/src/gen/org/jboss/seam/tool/UppercasePropertyTask.java
  
  Index: UppercasePropertyTask.java
  ===================================================================
  package org.jboss.seam.tool;
  
  import org.apache.tools.ant.BuildException;
  import org.apache.tools.ant.Task;
  
  public class UppercasePropertyTask extends Task
  {
     private String value;
     private String name;
     
     @Override
     public void execute() throws BuildException
     {
        if ( value!=null && !"".equals(value) )
        {
           getProject().setProperty( name, upper(value) );
        }
     }
  
     protected String upper(String name)
     {
        return name.substring(0, 1).toUpperCase() + name.substring(1);
     }
  
     public void setValue(String packageName)
     {
        this.value = packageName;
     }
  
     public void setName(String propertyName)
     {
        this.name = propertyName;
     }
  }
  
  
  



More information about the jboss-cvs-commits mailing list