net.ggtools.grand.ant
Class LinkFinderVisitor

java.lang.Object
  extended by net.ggtools.grand.ant.ReflectTaskVisitorBase
      extended by net.ggtools.grand.ant.LinkFinderVisitor
All Implemented Interfaces:
TaskVisitor

public class LinkFinderVisitor
extends ReflectTaskVisitorBase

A task visitor looking for links created by tasks like ant, antcall, etc.

Author:
Christophe Labouisse

Constructor Summary
LinkFinderVisitor(AntProject project)
           
 
Method Summary
 void defaultVisit(org.apache.tools.ant.RuntimeConfigurable wrapper)
          Default action for unknown task.
 java.lang.String getAliasForTask(java.lang.String taskName)
          A default implementation returning the task name.
 void reflectVisit_ant(org.apache.tools.ant.RuntimeConfigurable wrapper)
          Process the ant task.
 void reflectVisit_antcall(org.apache.tools.ant.RuntimeConfigurable wrapper)
          Process antcall and similar tasks.
 void reflectVisit_subant(org.apache.tools.ant.RuntimeConfigurable wrapper)
          Process subant task.
 void setGraph(AntGraph graph)
           
 void setStartNode(AntTargetNode startNode)
           
 
Methods inherited from class net.ggtools.grand.ant.ReflectTaskVisitorBase
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkFinderVisitor

public LinkFinderVisitor(AntProject project)
Method Detail

defaultVisit

public void defaultVisit(org.apache.tools.ant.RuntimeConfigurable wrapper)
                  throws GrandException
Default action for unknown task. The default behavior is to recurse in the children to find a possible task.

Specified by:
defaultVisit in class ReflectTaskVisitorBase
Parameters:
wrapper - wrapper to check.
Throws:
GrandException
See Also:
ReflectTaskVisitorBase.defaultVisit(org.apache.tools.ant.RuntimeConfigurable)

getAliasForTask

public java.lang.String getAliasForTask(java.lang.String taskName)
Description copied from class: ReflectTaskVisitorBase
A default implementation returning the task name.

Overrides:
getAliasForTask in class ReflectTaskVisitorBase
Returns:
the name to use when look for the method to invoke. Should not be null.

reflectVisit_ant

public void reflectVisit_ant(org.apache.tools.ant.RuntimeConfigurable wrapper)
                      throws DuplicateElementException
Process the ant task. This method will find or create the destination node of the task, create an AntTaskLinkand find the nested property nodes to set the link properties. Only name,value property nodes will be processed: the file property nodes will be ignored. The called node name will be either the plain target attribute value if it is located in the current build file or [target].

Parameters:
wrapper - the wrapper to process.
Throws:
DuplicateElementException - if a duplicate node is created, should not happen.

reflectVisit_antcall

public void reflectVisit_antcall(org.apache.tools.ant.RuntimeConfigurable wrapper)
                          throws DuplicateElementException
Process antcall and similar tasks. The method will create a link between the current start node and the node referenced by the target attribute creating it with the Node.ATTR_MISSING_NODEif no such node exists. It will then create an AntTaskLinklink and look for nested param elements to set parameters to newly created link.

Parameters:
wrapper - wrapper to process.
Throws:
DuplicateElementException - if a duplicate node is created (should not happen).

reflectVisit_subant

public void reflectVisit_subant(org.apache.tools.ant.RuntimeConfigurable wrapper)
                         throws DuplicateElementException
Process subant task. Depending of the existence of the genericantfile attribute, this method will either create a special link holding a list of directories or a set of ant taskish links. During those creations, the end nodes will be created with the Node.ATTR_MISSING_NODEattribute if needed.

Parameters:
wrapper - wrapper to process.
Throws:
DuplicateElementException - if a duplicate node is created (should not happen).

setGraph

public void setGraph(AntGraph graph)
Parameters:
graph - The graph to set.

setStartNode

public void setStartNode(AntTargetNode startNode)
Parameters:
startNode - The startNode to set.


Copyright © 2004-2005 ggTools. All Rights Reserved.