antsnest.datastructure
Class DefaultAntTarget

java.lang.Object
  extended by antsnest.datastructure.DefaultAntNode
      extended by antsnest.datastructure.DefaultAntTarget
All Implemented Interfaces:
AntNode, AntTarget, Serializable

public class DefaultAntTarget
extends DefaultAntNode
implements AntTarget

Implementation of AntTarget

Author:
Chris Clohosy
See Also:
AntTarget, Serialized Form

Constructor Summary
DefaultAntTarget()
          Constructs a new target
 
Method Summary
 void addDepends(String target, int position)
          Adds a target dependency to this target
 void addIf(String property, int position)
          Adds a property that must be set in order for this target to execute
 void addUnless(String property, int position)
          Adds a property that must not be set in order for this target to execute
 AntNode cloneNode(IDPool idPool)
          Gets a clone of this node
 String[] getDepends()
          Gets any targets this target depends on executing first
 String[] getIf()
          Gets any properties that must be set for this target to execute
 String getName()
          Gets the name of this node
 String[] getUnless()
          Gets any properties that must not be set for this target to execute
 void removeDepends(int position)
          Removes a target dependency from this target
 void removeDepends(String target)
          Removes a target dependency from this target
 void removeIf(int position)
          Removes a property that must be set in order for this target to execute
 void removeIf(String property)
          Removes a property that must be set in order for this target to execute
 void removeUnless(int position)
          Removes a property that must not be set in order for this target to execute
 void removeUnless(String property)
          Removes a property that must not be set in order for this target to execute
 void setName(String name)
          Sets the name of this node
 String toString()
          Provides a string representation of this target
 
Methods inherited from class antsnest.datastructure.DefaultAntNode
addAttribute, addAttribute, addNode, addNode, changeAttribute, equals, getAttribute, getAttribute, getAttributeSize, getData, getDescription, getIDPool, getNode, getNodeID, getNodeSize, getNodeText, getParent, getType, getTypeAt, indexOfAttribute, indexOfNode, moveAttribute, moveNode, removeAttribute, removeAttribute, removeNode, removeNode, setData, setDescription, setIDPool, setNodeID, setParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface antsnest.datastructure.AntNode
addAttribute, addAttribute, addNode, addNode, changeAttribute, getAttribute, getAttribute, getAttributeSize, getData, getDescription, getIDPool, getNode, getNodeID, getNodeSize, getNodeText, getParent, getType, getTypeAt, indexOfAttribute, indexOfNode, moveAttribute, moveNode, removeAttribute, removeAttribute, removeNode, removeNode, setData, setDescription, setIDPool, setNodeID, setParent
 

Constructor Detail

DefaultAntTarget

public DefaultAntTarget()
Constructs a new target

Method Detail

getName

public String getName()
Gets the name of this node

Specified by:
getName in interface AntNode
Overrides:
getName in class DefaultAntNode
Returns:
a String, the name

setName

public void setName(String name)
Sets the name of this node

Specified by:
setName in interface AntNode
Overrides:
setName in class DefaultAntNode
Parameters:
name - the new name

getDepends

public String[] getDepends()
Gets any targets this target depends on executing first

Specified by:
getDepends in interface AntTarget
Returns:
a String[], the dependencies

addDepends

public void addDepends(String target,
                       int position)
Adds a target dependency to this target

Specified by:
addDepends in interface AntTarget
Parameters:
target - the dependency name
position - where the dependency should be placed in the list

removeDepends

public void removeDepends(String target)
Removes a target dependency from this target

Specified by:
removeDepends in interface AntTarget
Parameters:
target - the dependency name to remove

removeDepends

public void removeDepends(int position)
Removes a target dependency from this target

Specified by:
removeDepends in interface AntTarget
Parameters:
position - the index of the dependency to remove

getIf

public String[] getIf()
Gets any properties that must be set for this target to execute

Specified by:
getIf in interface AntTarget
Returns:
a String[], the properties

addIf

public void addIf(String property,
                  int position)
Adds a property that must be set in order for this target to execute

Specified by:
addIf in interface AntTarget
Parameters:
property - the property name to add
position - where the property should be placed in the list

removeIf

public void removeIf(String property)
Removes a property that must be set in order for this target to execute

Specified by:
removeIf in interface AntTarget
Parameters:
property - the property name to remove

removeIf

public void removeIf(int position)
Removes a property that must be set in order for this target to execute

Specified by:
removeIf in interface AntTarget
Parameters:
position - the index of the property to remove

getUnless

public String[] getUnless()
Gets any properties that must not be set for this target to execute

Specified by:
getUnless in interface AntTarget
Returns:
a String[], the properties

addUnless

public void addUnless(String property,
                      int position)
Adds a property that must not be set in order for this target to execute

Specified by:
addUnless in interface AntTarget
Parameters:
property - the property name to add
position - where the property should be placed in the list

removeUnless

public void removeUnless(String property)
Removes a property that must not be set in order for this target to execute

Specified by:
removeUnless in interface AntTarget
Parameters:
property - the property name to remove

removeUnless

public void removeUnless(int position)
Removes a property that must not be set in order for this target to execute

Specified by:
removeUnless in interface AntTarget
Parameters:
position - the index of the property to remove

toString

public String toString()
Provides a string representation of this target

Overrides:
toString in class Object
Returns:
a String, the string representation

cloneNode

public AntNode cloneNode(IDPool idPool)
Gets a clone of this node

Specified by:
cloneNode in interface AntNode
Specified by:
cloneNode in class DefaultAntNode
Parameters:
idPool - an ID pool to use
Returns:
an AntNode, the cloned node