donaldp 2002/06/19 17:38:26
Modified: site/docs ant1compat.html buildfile.html building.html
classloader.html configuring.html differences.html
extending.html getinvolved.html index.html
librarys.html project-descriptor.html running.html
subprojects.html task.html todo.html vfs.html
site/src/xdocs types.xml
site/src/xdocs/stylesheets project.xml
Added: site/docs converters.html types.html
Log:
Integrate types documentation into main website
Revision Changes Path
1.11 +1 -1 jakarta-ant-myrmidon/site/docs/ant1compat.html
Index: ant1compat.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/ant1compat.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ant1compat.html 20 Jun 2002 00:34:21 -0000 1.10
+++ ant1compat.html 20 Jun 2002 00:38:25 -0000 1.11
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.12 +1 -1 jakarta-ant-myrmidon/site/docs/buildfile.html
Index: buildfile.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/buildfile.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- buildfile.html 20 Jun 2002 00:34:21 -0000 1.11
+++ buildfile.html 20 Jun 2002 00:38:25 -0000 1.12
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.8 +1 -1 jakarta-ant-myrmidon/site/docs/building.html
Index: building.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/building.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- building.html 20 Jun 2002 00:34:21 -0000 1.7
+++ building.html 20 Jun 2002 00:38:25 -0000 1.8
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.11 +1 -1 jakarta-ant-myrmidon/site/docs/classloader.html
Index: classloader.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/classloader.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- classloader.html 20 Jun 2002 00:34:21 -0000 1.10
+++ classloader.html 20 Jun 2002 00:38:25 -0000 1.11
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.11 +1 -1 jakarta-ant-myrmidon/site/docs/configuring.html
Index: configuring.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/configuring.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- configuring.html 20 Jun 2002 00:34:21 -0000 1.10
+++ configuring.html 20 Jun 2002 00:38:25 -0000 1.11
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.14 +1 -1 jakarta-ant-myrmidon/site/docs/differences.html
Index: differences.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/differences.html,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- differences.html 20 Jun 2002 00:34:21 -0000 1.13
+++ differences.html 20 Jun 2002 00:38:25 -0000 1.14
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.3 +1 -1 jakarta-ant-myrmidon/site/docs/extending.html
Index: extending.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/extending.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- extending.html 20 Jun 2002 00:34:21 -0000 1.2
+++ extending.html 20 Jun 2002 00:38:25 -0000 1.3
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.11 +1 -1 jakarta-ant-myrmidon/site/docs/getinvolved.html
Index: getinvolved.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/getinvolved.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- getinvolved.html 20 Jun 2002 00:34:21 -0000 1.10
+++ getinvolved.html 20 Jun 2002 00:38:25 -0000 1.11
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.11 +1 -1 jakarta-ant-myrmidon/site/docs/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/index.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- index.html 20 Jun 2002 00:34:21 -0000 1.10
+++ index.html 20 Jun 2002 00:38:25 -0000 1.11
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.11 +1 -1 jakarta-ant-myrmidon/site/docs/librarys.html
Index: librarys.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/librarys.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- librarys.html 20 Jun 2002 00:34:21 -0000 1.10
+++ librarys.html 20 Jun 2002 00:38:25 -0000 1.11
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.10 +1 -1 jakarta-ant-myrmidon/site/docs/project-descriptor.html
Index: project-descriptor.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/project-descriptor.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- project-descriptor.html 20 Jun 2002 00:34:21 -0000 1.9
+++ project-descriptor.html 20 Jun 2002 00:38:25 -0000 1.10
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.9 +1 -1 jakarta-ant-myrmidon/site/docs/running.html
Index: running.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/running.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- running.html 20 Jun 2002 00:34:21 -0000 1.8
+++ running.html 20 Jun 2002 00:38:25 -0000 1.9
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.10 +1 -1 jakarta-ant-myrmidon/site/docs/subprojects.html
Index: subprojects.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/subprojects.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- subprojects.html 20 Jun 2002 00:34:21 -0000 1.9
+++ subprojects.html 20 Jun 2002 00:38:25 -0000 1.10
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.11 +1 -1 jakarta-ant-myrmidon/site/docs/task.html
Index: task.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/task.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- task.html 20 Jun 2002 00:34:21 -0000 1.10
+++ task.html 20 Jun 2002 00:38:25 -0000 1.11
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.12 +1 -1 jakarta-ant-myrmidon/site/docs/todo.html
Index: todo.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/todo.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- todo.html 20 Jun 2002 00:34:21 -0000 1.11
+++ todo.html 20 Jun 2002 00:38:25 -0000 1.12
@@ -73,7 +73,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.11 +1 -1 jakarta-ant-myrmidon/site/docs/vfs.html
Index: vfs.html
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/vfs.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- vfs.html 20 Jun 2002 00:34:21 -0000 1.10
+++ vfs.html 20 Jun 2002 00:38:25 -0000 1.11
@@ -71,7 +71,7 @@
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
- <div><small> <a href="./type.html">Type HOWTO</a>
+ <div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
1.1 jakarta-ant-myrmidon/site/docs/converters.html
Index: converters.html
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!-- This is a generated file. Do not edit. -->
<html>
<head>
<style type="text/css">
@import url("./css/tigris.css");
@import url("./css/site.css");
</style>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"/>
<meta name="author" value="Peter Donald">
<meta name="email" value="[EMAIL PROTECTED]">
<title>Apache Myrmidon - On Converters in Ant 2</title>
</head>
<body marginwidth="0" marginheight="0" class="composite">
<div id="banner">
<table border="0" cellspacing="0" cellpadding="8" width="100%">
<!-- TOP IMAGE -->
<tr>
<td> <td colspan="2">
<a href="http://jakarta.apache.org"><img
src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left"
border="0"/></a>
</td>
</td>
<td><div align="right" valign="bottom"><b><font size="+3">Apache
Myrmidon</font></b></div></td>
</tr>
</table>
</div>
<table border="0" cellspacing="0" cellpadding="8" width="100%"
id="main">
<tr valign="top">
<!-- LEFT SIDE NAVIGATION -->
<td id="leftcol" width="20%">
<div id="navcolumn">
<div>
<strong>Myrmidon</strong>
<div><small> <a href="./index.html">Introduction</a>
</small></div>
<div><small> <a href="./getinvolved.html">Get Involved</a>
</small></div>
<div><small> <a href="./building.html">Building
Myrmidon</a>
</small></div>
<div><small> <a href="./todo.html">Todo List</a>
</small></div>
</div>
<div>
<strong>User Guide</strong>
<div><small> <a href="./running.html">Installing and
Running</a>
</small></div>
<div><small> <a href="./buildfile.html">Project File</a>
</small></div>
<div><small> <a href="./properties.html">Properties</a>
</small></div>
<div><small> <a href="./vfs.html">Virtual File System</a>
</small></div>
<div><small> <a href="./ant1compat.html">Ant 1
Compatibility Layer</a>
</small></div>
<div><small> <a href="./differences.html">Differences to
Ant 1</a>
</small></div>
<div><small> <a href="./task.html">My First Task</a>
</small></div>
</div>
<div>
<strong>Extending Myrmidon</strong>
<div><small> <a href="./extending.html">Introduction</a>
</small></div>
<div><small> <a href="./configuring.html">Configuration
HOWTO</a>
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
<div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
<div><small> <a href="./librarys.html">Library HOWTO</a>
</small></div>
</div>
<div>
<strong>Developers Guide</strong>
<div><small> <a href="./subprojects.html">Sub Projects</a>
</small></div>
<div><small> <a href="./project-descriptor.html">The Build
System</a>
</small></div>
</div>
</div>
</td>
<td><div id="bodycol"><div class="app">
<div class="h3">
<h3><a name="Introduction">Introduction</a></h3>
<p
> This section will describe in detail the converter
architecture.
Converting occurs during configuring process of a task. When a
value
must be converted from one type (usually String) to the type of
an
attribute.
</p>
</div>
<div class="h3">
<h3><a name="Converters as Types">Converters as Types</a></h3>
<p
> Like most of the other pluggable elements in
Ant, a Converter is just
another
<a href="types.html">type</a>
. In this case each converter converts
from a source type to a destination class.
</p>
<p
> Converters used when you need to convert from
type to another type.
Usually this occurs when mapping the attributes of ModelElements
onto
a java class during the
<a
href="configuring.html">configuration</a>
process.
</p>
<p
> For example, if the attribute is of type Integer then the
runtime
will attempt to convert froma "java.lang.String" to a
"java.lang.Integer". In the case that there is a converter that
is
capable of directly between source type and destination this
converter
is used. In the case where there is no direct coverter then the
runtime
searches for a converter that is capable of doing conversion.
</p>
<p
> The search process is as follows;
</p>
<ul
>
<li
> Check if current class can be converted to destination type.
</li>
<li
> Repeat search for all interfaces that class implements.
</li>
<li
> Repeat search for super class.
</li>
</ul>
</div>
</div>
<div align="right" id="authors">by
<a href="[EMAIL PROTECTED]">Peter Donald</a>
</div>
</div></td>
</tr>
</table>
<!-- FOOTER -->
<div id="footer">
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td>Copyright © 2000-2002, Apache Software Foundation</td>
</tr>
</table>
</div>
</body>
</html>
1.1 jakarta-ant-myrmidon/site/docs/types.html
Index: types.html
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!-- This is a generated file. Do not edit. -->
<html>
<head>
<style type="text/css">
@import url("./css/tigris.css");
@import url("./css/site.css");
</style>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"/>
<meta name="author" value="Peter Donald">
<meta name="email" value="[EMAIL PROTECTED]">
<title>Apache Myrmidon - On Roles and Types in Ant 2</title>
</head>
<body marginwidth="0" marginheight="0" class="composite">
<div id="banner">
<table border="0" cellspacing="0" cellpadding="8" width="100%">
<!-- TOP IMAGE -->
<tr>
<td> <td colspan="2">
<a href="http://jakarta.apache.org"><img
src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left"
border="0"/></a>
</td>
</td>
<td><div align="right" valign="bottom"><b><font size="+3">Apache
Myrmidon</font></b></div></td>
</tr>
</table>
</div>
<table border="0" cellspacing="0" cellpadding="8" width="100%"
id="main">
<tr valign="top">
<!-- LEFT SIDE NAVIGATION -->
<td id="leftcol" width="20%">
<div id="navcolumn">
<div>
<strong>Myrmidon</strong>
<div><small> <a href="./index.html">Introduction</a>
</small></div>
<div><small> <a href="./getinvolved.html">Get Involved</a>
</small></div>
<div><small> <a href="./building.html">Building
Myrmidon</a>
</small></div>
<div><small> <a href="./todo.html">Todo List</a>
</small></div>
</div>
<div>
<strong>User Guide</strong>
<div><small> <a href="./running.html">Installing and
Running</a>
</small></div>
<div><small> <a href="./buildfile.html">Project File</a>
</small></div>
<div><small> <a href="./properties.html">Properties</a>
</small></div>
<div><small> <a href="./vfs.html">Virtual File System</a>
</small></div>
<div><small> <a href="./ant1compat.html">Ant 1
Compatibility Layer</a>
</small></div>
<div><small> <a href="./differences.html">Differences to
Ant 1</a>
</small></div>
<div><small> <a href="./task.html">My First Task</a>
</small></div>
</div>
<div>
<strong>Extending Myrmidon</strong>
<div><small> <a href="./extending.html">Introduction</a>
</small></div>
<div><small> <a href="./configuring.html">Configuration
HOWTO</a>
</small></div>
<div><small> <a href="./converters.html">Converter
HOWTO</a>
</small></div>
<div><small> <a href="./types.html">Type HOWTO</a>
</small></div>
<div><small> <a href="./classloader.html">ClassLoader
HOWTO</a>
</small></div>
<div><small> <a href="./librarys.html">Library HOWTO</a>
</small></div>
</div>
<div>
<strong>Developers Guide</strong>
<div><small> <a href="./subprojects.html">Sub Projects</a>
</small></div>
<div><small> <a href="./project-descriptor.html">The Build
System</a>
</small></div>
</div>
</div>
</td>
<td><div id="bodycol"><div class="app">
<div class="h3">
<h3><a name="Introduction">Introduction</a></h3>
<p
> Where as Ant1 can be said to be be Task-centric, Myrmidon
can be said to be type-centric. To extend the runtime you write
a java class (a type) that implements various interfaces.
</p>
</div>
<div class="h3">
<h3><a name="Roles">Roles</a></h3>
<p
> <a href="$element.getAttributeValue(
"href" )"></a>
Myrmidon places types in one or more categories.
Each category
represents a set of types that conform to a certain contract or
role. Some example roles include "task",
"data-type", "condition",
"converter" etc.
</p>
<p
> Associated with each role is a java interface. The java
interface
must be implemented by all types in that role. So the "task" role
may
be associated with the "org.apache.myrmidon.api.Task" interface
while
the "converter" role may be associated with the
"org.apache.excalibur.converter.Converter" interface.
</p>
<p
> So you could place the
<code
> org.apache.ant.CopyFileTask
</code>
into
the "task" role but it would be invalid to place it in
the "converter"
role as it does not implement the converter interface.
</p>
<p
> Currently the roles in the runtime are loaded
from the
<em
> Shared
</em>
classloader (See
<a
href="classloaders.html">ClassLoaders</a>
for an over
view of classloaders). In the future the roles may also be loaded
from
<a href="librarys.html">Ant Libraries</a>
but due to some classloader
issues this is currently not possible.
</p>
<p
> The runtime learns about the roles by reading a
descriptor present in
jar files under name
<code
> META-INF/ant-roles.xml
</code>
. This xml descriptor
maps a short human readable role name (such as "task")
to the name of the
interface associated with role (ie
"org.apache.myrmidon.api.Task"). The runtime
expects that the interface defining role is present in the jar
that the
descriptor was loaded from.
</p>
<p
> An example descriptor follows;
</p>
<div id="source">
<pre><roles version="1.0">
<role name="task"
classname="org.apache.myrmidon.api.Task"/>
<role name="task-listener"
classname="org.apache.myrmidon.api.event.TaskListener"/>
</roles></pre>
</div>
</div>
<div class="h3">
<h3><a name="Types">Types</a></h3>
<p
> <a href="$element.getAttributeValue(
"href" )"></a>
A Type is an implementation of one or more Roles.
Consider the role of "task";
all the tasks in ant are considered different types that are in a
particular role.
So <copy/> is a type in the "task" role,
""file-exists" is a type in the
"condition" role, "fileset" is a type in the
"data-type" role etc. If a user wishes
to customize ant for their own build process or environment, it
is likely that they
will be implementing a type of some sort.
</p>
<p
> The type is registered into the ant runtime using a shortname
that may be prefixed
with a namespace. The namespace is separated from remainder of
shortname by a '.'
character. Each type also has an implementation key. In most
cases the implementation
key coresponds to the name of the class that implements the type.
</p>
<p
> For instance consider the copy task, it has a shortname of
"file.copy" (note the
namespace "file") and an implementation key of
"org.apache.antlibs.file.CopyTask".
</p>
<p
> When a type needs to be created the first thing that occurs is
the implementation key
is retrieved. This implementation key is then passed to a
TypeFactory. The TypeFactory
then creates an instance of the typeand returns the instance to
caller. This may sound
complicated but luckily it is done behind the scenes. The caller
only need to say they
need a instance of type with specific shortname and an instance
is created and
returned.
</p>
<p
> Types are registered into the ant runtime using
another file descriptor stored in
jar library files. The xml descriptors are retrieved from
libraries from a file with path
<code
> META-INF/ant-types.xml
</code>
. The format of the of the descriptor is extensible
and thus not able to be fully defined by a DTD. For the vast
majority of types there is
a single XML element describing the type. The name of the element
is the name of the role
under which type is being registered. The XML element also has a
impl attribute (that
coresponds to implementation key) and a name attribute (that
coresponds to shortname of type
sans any namespace information).
</p>
<p
> For example if you wished to register the above mentioned copy
task you would use a
descriptor that looks like;
</p>
<div id="source">
<pre><types version="1.0">
<task name="copy"
impl="org.apache.antlibs.file.CopyTask"/>
</types></pre>
</div>
<p
> In some advanced cases you may see a factory attribute
specified in the type definition.
This indicates that the type needs to be loaded using a
non-standard TypeFactory. This can occur
where the implementation key does not represent a class or
represents a class that needs to be
wrapped to conform to the type. For example, Ant1.x tasks can be
registered as a normal Ant2
task if they use a special factory that loads the Ant1 task and
wraps it in an Ant2 class.
Another example would defining a task using an xml snippet as a
form of templating. The
implementation key would be the path of the xml snippet in jar
and the factory would load the
xml snippet and interpret it to create a task.
</p>
<p
> In other circumstances you may notice other attributes used in
the type descriptor. This is
because some roles can declare that they need the types need to
specify extra metadata. For
instance the "converter" role requires that type implementations
specify the source and destination
classes which they convert from and to respectively.
</p>
</div>
</div>
<div align="right" id="authors">by
<a href="[EMAIL PROTECTED]">Peter Donald</a>
</div>
</div></td>
</tr>
</table>
<!-- FOOTER -->
<div id="footer">
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td>Copyright © 2000-2002, Apache Software Foundation</td>
</tr>
</table>
</div>
</body>
</html>
1.2 +1 -1 jakarta-ant-myrmidon/site/src/xdocs/types.xml
Index: types.xml
===================================================================
RCS file: /home/cvs/jakarta-ant-myrmidon/site/src/xdocs/types.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- types.xml 20 Jun 2002 00:35:53 -0000 1.1
+++ types.xml 20 Jun 2002 00:38:25 -0000 1.2
@@ -31,7 +31,7 @@
<p>Currently the roles in the runtime are loaded from the
<em>Shared</em>
classloader (See <a href="classloaders.html">ClassLoaders</a>
for an over
view of classloaders). In the future the roles may also be
loaded from
- <a href="librarys.html">Ant Libraries</> but due to some
classloader
+ <a href="librarys.html">Ant Libraries</a> but due to some
classloader
issues this is currently not possible.</p>
<p>The runtime learns about the roles by reading a descriptor
present in
jar files under name <code>META-INF/ant-roles.xml</code>. This
xml descriptor
1.10 +1 -1
jakarta-ant-myrmidon/site/src/xdocs/stylesheets/project.xml
Index: project.xml
===================================================================
RCS file:
/home/cvs/jakarta-ant-myrmidon/site/src/xdocs/stylesheets/project.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- project.xml 20 Jun 2002 00:34:22 -0000 1.9
+++ project.xml 20 Jun 2002 00:38:26 -0000 1.10
@@ -24,7 +24,7 @@
<item name="Introduction" href="/extending.html"/>
<item name="Configuration HOWTO" href="/configuring.html"/>
<item name="Converter HOWTO" href="/converters.html"/>
- <item name="Type HOWTO" href="/type.html"/>
+ <item name="Type HOWTO" href="/types.html"/>
<item name="ClassLoader HOWTO" href="/classloader.html"/>
<item name="Library HOWTO" href="/librarys.html"/>
</menu>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>