ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/helper ProjectHelperImpl.java
Date Thu, 11 Jul 2002 07:46:35 GMT
bodewig     2002/07/11 00:46:35

  Modified:    src/main/org/apache/tools/ant/helper ProjectHelperImpl.java
  Log:
  Allow all tasks to be used outside of targets.
  
  Revision  Changes    Path
  1.9       +6 -42     jakarta-ant/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
  
  Index: ProjectHelperImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ProjectHelperImpl.java	9 Jul 2002 21:05:58 -0000	1.8
  +++ ProjectHelperImpl.java	11 Jul 2002 07:46:34 -0000	1.9
  @@ -502,24 +502,20 @@
            *            or a data type definition
            */
           public void startElement(String name, AttributeList attrs) throws SAXParseException
{
  -            if (name.equals("taskdef")) {
  -                handleTaskdef(name, attrs);
  -            } else if (name.equals("typedef")) {
  -                handleTypedef(name, attrs);
  -            } else if (name.equals("property")) {
  -                handleProperty(name, attrs);
  -            } else if (name.equals("target")) {
  +            if (name.equals("target")) {
                   handleTarget(name, attrs);
               } else if (helperImpl.project.getDataTypeDefinitions().get(name) != null) {
                   handleDataType(name, attrs);
  +            } else if (helperImpl.project.getTaskDefinitions().get(name) != null) {
  +                handleTask(name, attrs);
               } else {
                   throw new SAXParseException("Unexpected element \"" + name + "\"", helperImpl.locator);
               }
           }
   
           /**
  -         * Handles a task defintion element by creating a task handler
  -         * and initialising is with the details of the element.
  +         * Handles a task by creating a task handler and initialising
  +         * is with the details of the element.
            *
            * @param name The name of the element to be handled.
            *            Will not be <code>null</code>.
  @@ -530,39 +526,7 @@
            *                              the task handler
            *
            */
  -        private void handleTaskdef(String name, AttributeList attrs) throws SAXParseException
{
  -            (new TaskHandler(helperImpl, this, null, null, null)).init(name, attrs);
  -        }
  -
  -        /**
  -         * Handles a type defintion element by creating a task handler
  -         * and initialising is with the details of the element.
  -         *
  -         * @param name The name of the element to be handled.
  -         *            Will not be <code>null</code>.
  -         * @param attrs Attributes of the element to be handled.
  -         *              Will not be <code>null</code>.
  -         *
  -         * @exception SAXParseException if an error occurs initialising the
  -         *                              handler
  -         */
  -        private void handleTypedef(String name, AttributeList attrs) throws SAXParseException
{
  -            (new TaskHandler(helperImpl, this, null, null, null)).init(name, attrs);
  -        }
  -
  -        /**
  -         * Handles a property defintion element by creating a task handler
  -         * and initialising is with the details of the element.
  -         *
  -         * @param name The name of the element to be handled.
  -         *            Will not be <code>null</code>.
  -         * @param attrs Attributes of the element to be handled.
  -         *              Will not be <code>null</code>.
  -         *
  -         * @exception SAXParseException if an error occurs initialising
  -         *                              the handler
  -         */
  -        private void handleProperty(String name, AttributeList attrs) throws SAXParseException
{
  +        private void handleTask(String name, AttributeList attrs) throws SAXParseException
{
               (new TaskHandler(helperImpl, this, null, null, null)).init(name, attrs);
           }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message