Ant API: Class Project

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tools.ant
Class Project

    java.lang.Object
      |
      +--org.apache.tools.ant.Project

public class Project
extends java.lang.Object

Central representation of an Ant project. This class defines a Ant project with all of it's targets and tasks. It also provides the mechanism to kick off a build using a particular target name.

This class also encapsulates methods which allow Files to be refered to using abstract path names which are translated to native system file paths at runtime as well as defining various project properties.

Author:
  duncan@x180.com

Field Summary
`static java.lang.String` | `JAVA_1_0`
`static java.lang.String` | `JAVA_1_1`
`static java.lang.String` | `JAVA_1_2`
`static java.lang.String` | `JAVA_1_3`
`static int` | `MSG_ERR`
`static int` | `MSG_INFO`
`static int` | `MSG_VERBOSE`
`static int` | `MSG_WARN`
`static java.lang.String` | `TOKEN_END`
`static java.lang.String` | `TOKEN_START`

Constructor Summary
`Project(java.io.PrintStream out, int msgOutputLevel)`

Method Summary
`void` | `addFilter(java.lang.String token, java.lang.String value)`
`void` | `addOrReplaceTarget(java.lang.String targetName, Target target)`
`void` | `addOrReplaceTarget(Target target)`
`void` | `addReference(java.lang.String name, java.lang.Object value)`
`void` | `addTarget(java.lang.String targetName, Target target)` This call expects to add a new Target.
`void` | `addTarget(Target target)` This call expects to add a new Target.
`void` | `addTaskDefinition(java.lang.String taskName, java.lang.Class taskClass)`
`void` | `copyFile(java.io.File sourceFile, java.io.File destFile)` Convienence method to copy a file from a source to a destination.
`void` | `copyFile(java.io.File sourceFile, java.io.File destFile, boolean filtering)` Convienence method to copy a file from a source to a destination specifying if token filtering must be used.
`void` | `copyFile(java.lang.String sourceFile, java.lang.String destFile)` Convienence method to copy a file from a source to a destination.
`void` | `copyFile(java.lang.String sourceFile, java.lang.String destFile, boolean filtering)` Convienence method to copy a file from a source to a destination specifying if token filtering must be used.
`Task` | `createTask(java.lang.String taskType)`
`void` | `executeTarget(java.lang.String targetName)`
`java.io.File` | `getBaseDir()`
`java.lang.String` | `getDefaultTarget()`
`java.util.Hashtable` | `getFilters()`
`static java.lang.String` | `getJavaVersion()`
`java.lang.String` | `getName()`
`java.io.PrintStream` | `getOutput()`
`int` | `getOutputLevel()`
`java.util.Hashtable` | `getProperties()`
`java.lang.String` | `getProperty(java.lang.String name)`
`java.util.Hashtable` | `getReferences()`
`java.util.Hashtable` | `getTargets()`
`java.util.Hashtable` | `getUserProperties()`
`void` | `log(java.lang.String msg)`
`void` | `log(java.lang.String msg, int msgLevel)`
`void` | `log(java.lang.String msg, java.lang.String tag, int msgLevel)`
`java.io.File` | `resolveFile(java.lang.String fileName)`
`void` | `setBaseDir(java.io.File baseDir)`
`void` | `setBasedir(java.lang.String baseD)`
`void` | `setDefault(java.lang.String defaultTarget)`
`void` | `setDefaultTarget(java.lang.String defaultTarget)`
`void` | `setName(java.lang.String name)`
`void` | `setOutput(java.io.PrintStream out)`
`void` | `setProperty(java.lang.String name, java.lang.String value)`
`void` | `setUserProperty(java.lang.String name, java.lang.String value)`
`static boolean` | `toBoolean(java.lang.String s)` returns the boolean equivalent of a string, which is considered true if either "on", "true", or "yes" is found, ignoring case.
`java.lang.String` | `translatePath(java.lang.String to_process)` Translate a path into its native (platform specific) path.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MSG_ERR

    public static final int MSG_ERR

### MSG_WARN

    public static final int MSG_WARN

### MSG_INFO

    public static final int MSG_INFO

### MSG_VERBOSE

    public static final int MSG_VERBOSE

### JAVA_1_0

    public static final java.lang.String JAVA_1_0

### JAVA_1_1

    public static final java.lang.String JAVA_1_1

### JAVA_1_2

    public static final java.lang.String JAVA_1_2

### JAVA_1_3

    public static final java.lang.String JAVA_1_3

### TOKEN_START

    public static final java.lang.String TOKEN_START

### TOKEN_END

    public static final java.lang.String TOKEN_END

Constructor Detail

### Project

    public Project(java.io.PrintStream out,
                   int msgOutputLevel)

Method Detail

### getOutput

    public java.io.PrintStream getOutput()

### setOutput

    public void setOutput(java.io.PrintStream out)

### getOutputLevel

    public int getOutputLevel()

### log

    public void log(java.lang.String msg)

### log

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

### log

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

### setProperty

    public void setProperty(java.lang.String name,
                            java.lang.String value)

### setUserProperty

    public void setUserProperty(java.lang.String name,
                                java.lang.String value)

### getProperty

    public java.lang.String getProperty(java.lang.String name)

### getProperties

    public java.util.Hashtable getProperties()

### getUserProperties

    public java.util.Hashtable getUserProperties()

### setDefaultTarget

    public void setDefaultTarget(java.lang.String defaultTarget)

### getDefaultTarget

    public java.lang.String getDefaultTarget()

### setDefault

    public void setDefault(java.lang.String defaultTarget)

### setName

    public void setName(java.lang.String name)

### getName

    public java.lang.String getName()

### addFilter

    public void addFilter(java.lang.String token,
                          java.lang.String value)

### getFilters

    public java.util.Hashtable getFilters()

### setBasedir

    public void setBasedir(java.lang.String baseD)
                    throws BuildException

### setBaseDir

    public void setBaseDir(java.io.File baseDir)

### getBaseDir

    public java.io.File getBaseDir()

### getJavaVersion

    public static java.lang.String getJavaVersion()

### addTaskDefinition

    public void addTaskDefinition(java.lang.String taskName,
                                  java.lang.Class taskClass)

### addTarget

    public void addTarget(Target target)

  This call expects to add a new Target.
  Parameters:
    `target` - is the Target to be added to the current Project.
  Throws:
    BuildException - if the Target already exists in the project.
  See Also:
    `to replace existing Targets.`

### addTarget

    public void addTarget(java.lang.String targetName,
                          Target target)
                   throws BuildException

  This call expects to add a new Target.
  Parameters:
    `target` - is the Target to be added to the current Project.
    `targetName` - is the name to use for the Target
  Throws:
    BuildException - if the Target already exists in the project.
  See Also:
    `to replace existing Targets.`

### addOrReplaceTarget

    public void addOrReplaceTarget(Target target)

  Parameters:
    `target` - is the Target to be added or replaced in the current Project.

### addOrReplaceTarget

    public void addOrReplaceTarget(java.lang.String targetName,
                                   Target target)

  Parameters:
    `target` - is the Target to be added/replaced in the current Project.
    `targetName` - is the name to use for the Target

### getTargets

    public java.util.Hashtable getTargets()

### createTask

    public Task createTask(java.lang.String taskType)
                    throws BuildException

### executeTarget

    public void executeTarget(java.lang.String targetName)
                       throws BuildException

### resolveFile

    public java.io.File resolveFile(java.lang.String fileName)

### translatePath

    public java.lang.String translatePath(java.lang.String to_process)

  Translate a path into its native (platform specific) path. This should be extremely fast, code is borrowed from ECS project.

  All it does is translate the : into ; and / into \ if needed. In other words, it isn't perfect.

### copyFile

    public void copyFile(java.lang.String sourceFile,
                         java.lang.String destFile)
                  throws java.io.IOException

  Convienence method to copy a file from a source to a destination. No filtering is performed.
  Throws:
    java.io.IOException -

### copyFile

    public void copyFile(java.lang.String sourceFile,
                         java.lang.String destFile,
                         boolean filtering)
                  throws java.io.IOException

  Convienence method to copy a file from a source to a destination specifying if token filtering must be used.
  Throws:
    java.io.IOException -

### copyFile

    public void copyFile(java.io.File sourceFile,
                         java.io.File destFile)
                  throws java.io.IOException

  Convienence method to copy a file from a source to a destination. No filtering is performed.
  Throws:
    java.io.IOException -

### copyFile

    public void copyFile(java.io.File sourceFile,
                         java.io.File destFile,
                         boolean filtering)
                  throws java.io.IOException

  Convienence method to copy a file from a source to a destination specifying if token filtering must be used.
  Throws:
    java.io.IOException -

### toBoolean

    public static boolean toBoolean(java.lang.String s)

  returns the boolean equivalent of a string, which is considered true if either "on", "true", or "yes" is found, ignoring case.

### addReference

    public void addReference(java.lang.String name,
                             java.lang.Object value)

### getReferences

    public java.util.Hashtable getReferences()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache Software Foundation. All Rights Reserved.