TypeFound (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.condition, class: TypeFound

# Class TypeFound

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.TypeFound

All Implemented Interfaces:
  `Cloneable, Condition`

public class TypeFound extends ProjectComponent implements Condition
looks for a task or other Ant type that exists. Existence is defined as the type is defined, and its implementation class is present. This will work for datatypes and preset, script and macro definitions.

- ## Field Summary

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TypeFound()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `doesTypeExist(String typename)`
  test for a task or other ant type existing in the current project
  `boolean`
  `eval()`
  Is this condition true?
  `void`
  `setName(String name)`
  the task or other type to look for
  `void`
  `setURI(String uri)`
  The URI for this definition.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TypeFound

    public TypeFound()

- ## Method Details

  - ### setName

    public void setName(String name)
    the task or other type to look for
    Parameters:
      `name` - the name of the type

  - ### setURI

    public void setURI(String uri)
    The URI for this definition.
    Parameters:
      `uri` - the namespace URI. If this is not set, use the default ant namespace.

  - ### doesTypeExist

    protected boolean doesTypeExist(String typename)
    test for a task or other ant type existing in the current project
    Parameters:
      `typename` - the name of the type
    Returns:
      true if the typename exists

  - ### eval

    public boolean eval() throws BuildException
    Is this condition true?
    Specified by:
      `eval` in interface `Condition`
    Returns:
      true if the condition is true
    Throws:
      `BuildException` - if an error occurs