Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.objectstyle.woproject.ant
Class ProjectFormat  view ProjectFormat download ProjectFormat.java

java.lang.Object
  extended byorg.objectstyle.woproject.ant.ProjectFormat
Direct Known Subclasses:
AppFormat, FrameworkFormat

public abstract class ProjectFormat
extends java.lang.Object

Abstract helper class that defines the algorithm for autogeneration of standard project files needed for deployment of the applications and frameworks. In a way it "formats" deployed project.


Field Summary
protected static java.lang.String endLine
           
protected  WOTask task
           
 
Constructor Summary
ProjectFormat(WOTask task)
          Creates new TemplateFilter and initializes it with the name of the project being built.
 
Method Summary
 void copyFile(java.io.InputStream src, java.io.File destFile, org.apache.tools.ant.types.FilterSetCollection filters)
          Convienence method to copy a file from a source to a destination specifying if token filtering must be used.
abstract  java.util.Iterator fileIterator()
          Returns an iterator over String objects that specify paths of the files to be created during the build process.
abstract  org.apache.tools.ant.types.FilterSetCollection filtersForTarget(java.lang.String targetName)
          Returns a FilterSetCollection that should be applied when generating a target file.
 java.lang.String getJarName()
          Returns a name of the jar WebObjects project being built with ".jar" appended.
 java.lang.String getName()
          Returns a name of WebObjects project being built.
 org.apache.tools.ant.types.FilterSetCollection infoFilter(java.util.Iterator extLibs)
          Returns a FilterSet that can be used to build Info.plist file.
private  java.lang.String libString(java.util.Iterator extLibs)
          Returns a string that can be used in Info.plist file to indicate JARs required by the project.
 void log(java.lang.String msg)
           
 void log(java.lang.String msg, int msgLevel)
           
private  java.lang.String principalClassString()
          Returns a string that can be used in Info.plist file to indicate the principal class for the framework or app.
 void processTemplates()
          Creates all needed files based on WOProject templates.
abstract  java.lang.String templateForTarget(java.lang.String targetName)
          Returns a path to the template that should be used to build a target file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endLine

protected static final java.lang.String endLine

task

protected WOTask task
Constructor Detail

ProjectFormat

public ProjectFormat(WOTask task)
Creates new TemplateFilter and initializes it with the name of the project being built.

Method Detail

getName

public java.lang.String getName()
Returns a name of WebObjects project being built.


getJarName

public java.lang.String getJarName()
Returns a name of the jar WebObjects project being built with ".jar" appended.


processTemplates

public void processTemplates()
                      throws org.apache.tools.ant.BuildException
Creates all needed files based on WOProject templates. This is a main worker method.


fileIterator

public abstract java.util.Iterator fileIterator()
Returns an iterator over String objects that specify paths of the files to be created during the build process.


templateForTarget

public abstract java.lang.String templateForTarget(java.lang.String targetName)
                                            throws org.apache.tools.ant.BuildException
Returns a path to the template that should be used to build a target file.


filtersForTarget

public abstract org.apache.tools.ant.types.FilterSetCollection filtersForTarget(java.lang.String targetName)
                                                                         throws org.apache.tools.ant.BuildException
Returns a FilterSetCollection that should be applied when generating a target file.


copyFile

public void copyFile(java.io.InputStream src,
                     java.io.File destFile,
                     org.apache.tools.ant.types.FilterSetCollection filters)
              throws java.io.IOException
Convienence method to copy a file from a source to a destination specifying if token filtering must be used.

This method is copied from Ant FileUtils with some changes and simplifications. FileUtils can't be used directly, since its API doesn't allow InputStreams for the source file.


libString

private java.lang.String libString(java.util.Iterator extLibs)
Returns a string that can be used in Info.plist file to indicate JARs required by the project.


principalClassString

private java.lang.String principalClassString()
Returns a string that can be used in Info.plist file to indicate the principal class for the framework or app.


infoFilter

public org.apache.tools.ant.types.FilterSetCollection infoFilter(java.util.Iterator extLibs)
Returns a FilterSet that can be used to build Info.plist file.


log

public void log(java.lang.String msg)

log

public void log(java.lang.String msg,
                int msgLevel)