the previous chapter’s buildfile example, you saw
fileset DataType being used to identify groups
of files to copy in order to deploy the irssibot application.
DataTypes are important when using Ant, and
fileset is just one of the many available to you:
Let’s dig in and learn more about these fundamental Ant DataTypes. They are building blocks used by tasks and are essential to using Ant effectively. In this chapter, we’ll talk about each DataType in detail. Before doing that, however, we discuss briefly how DataTypes fit into Ant’s overall design, and explain the notation used in this chapter to describe the attributes for the different DataTypes.
DataTypes are found in the
org.apache.tools.ant.types package, usually
extending from the
org.apache.tools.ant.types.DataType base class.
Reference are also treated as DataTypes, although
they do not extend from
DataType. Figure 4-1 contains a basic UML class diagram
illustrating this aspect of Ant’s design.
The base class,
logging functionality as well as access to the
Project object. Not shown here,
ProjectComponent is also the base class for every
Ant task. These tasks are detailed in Chapter 7 and Chapter 8.
While the class diagram helps to explain what DataTypes are, understanding the internal structure of Ant is rarely necessary. In most cases you simply want to write buildfiles and use Ant. For this reason, the remainder of this chapter focuses on how these types are used, rather than how their internal implementation works.