ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject roles, restricted types
Date Thu, 12 Feb 2004 16:30:56 GMT
Hi,
I have reactivated my code for restricted/roled types.

The basic idea is that one can define a type that can only
be used as a nested element in a type container. The type
may not be used at the top-level.

The main usecase is to remove the need for type containers
to implement all the allXX methods for current conditions/selectors
etc.

For example there is an "or" condition, and an "or" selector.

The patch allows these two to be defined as restricted typedefs:

    <typedef name="or"
             contract="org.apache.tools.ant.taskdefs.condition.Condition"
             classname="org.apache.tools.ant.taskdefs.condition.Or"/>

    <typedef name="or"
             contract="org.apache.tools.ant.types.selectors.FileSelector"
             classname="org.apache.tools.ant.types.selectors.OrSelector"/>


These may be placed in a antlib.

The idea would be to make an Ant antlib.xml containing all the 
conditions. selectors,
mappers and filters.

The user-level issues would be:
Is the attribute "contact" a good name for this attribute (use "role", 
"restrict", "instanceof" or ?).

Should this be a separate task and not typedef.
For example:
  <nestedtype name="or" 
instanceof="org.apache.tools.ant.taskdefs.condition.Condition"
                      
classname="org.apache.tools.ant.taskdefs.condition.Or"/>

Peter

Mime
View raw message