ProjectHelper2.TargetHandler (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.helper, class: ProjectHelper2, class: TargetHandler

# Class ProjectHelper2.TargetHandler

java.lang.Object
org.apache.tools.ant.helper.ProjectHelper2.AntHandler
org.apache.tools.ant.helper.ProjectHelper2.TargetHandler

Enclosing class:
  `ProjectHelper2`

public static class ProjectHelper2.TargetHandler extends ProjectHelper2.AntHandler
Handler for "target" and "extension-point" elements.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TargetHandler()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onEndElement(String uri, String tag, AntXMLContext context)`
  Handle the end of the project, sets the current target of the context to be the implicit target.
  `ProjectHelper2.AntHandler`
  `onStartChild(String uri, String name, String qname, Attributes attrs, AntXMLContext context)`
  Handles the start of an element within a target.
  `void`
  `onStartElement(String uri, String tag, String qname, Attributes attrs, AntXMLContext context)`
  Initialisation routine called after handler creation with the element name and attributes.

  ### Methods inherited from class ProjectHelper2.AntHandler

  `characters, checkNamespace, onEndChild`
  Modifier and Type
  Method
  Description
  `void`
  `characters(char[] buf, int start, int count, AntXMLContext context)`
  Handles text within an element.
  `protected void`
  `checkNamespace(String uri)`
  Will be called every time a namespace is reached.
  `void`
  `onEndChild(String uri, String tag, String qname, AntXMLContext context)`
  Handle the end of a element.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### TargetHandler

    public TargetHandler()

- ## Method Details

  - ### onStartElement

    public void onStartElement(String uri, String tag, String qname, Attributes attrs, AntXMLContext context) throws SAXParseException
    Initialisation routine called after handler creation with the element name and attributes. The attributes which this handler can deal with are: `"name"`, `"depends"`, `"if"`, `"unless"`, `"id"` and `"description"`.
    Overrides:
      `onStartElement` in class `ProjectHelper2.AntHandler`
    Parameters:
      `uri` - The namespace URI for this element.
      `tag` - Name of the element which caused this handler to be created. Should not be `null`. Ignored in this implementation.
      `qname` - The qualified name for this element.
      `attrs` - Attributes of the element which caused this handler to be created. Must not be `null`.
      `context` - The current context.
    Throws:
      `SAXParseException` - if an unexpected attribute is encountered or if the `"name"` attribute is missing.

  - ### onStartChild

    public ProjectHelper2.AntHandler onStartChild(String uri, String name, String qname, Attributes attrs, AntXMLContext context) throws SAXParseException
    Handles the start of an element within a target.
    Overrides:
      `onStartChild` in class `ProjectHelper2.AntHandler`
    Parameters:
      `uri` - The namespace URI for this element.
      `name` - The name of the element being started. Will not be `null`.
      `qname` - The qualified name for this element.
      `attrs` - Attributes of the element being started. Will not be `null`.
      `context` - The current context.
    Returns:
      an element handler.
    Throws:
      `SAXParseException` - if an error occurs when initialising the appropriate child handler

  - ### onEndElement

    public void onEndElement(String uri, String tag, AntXMLContext context)
    Handle the end of the project, sets the current target of the context to be the implicit target.
    Overrides:
      `onEndElement` in class `ProjectHelper2.AntHandler`
    Parameters:
      `uri` - The namespace URI of the element.
      `tag` - The name of the element.
      `context` - The current context.