org.apache.tools.ant
Class IntrospectionHelper

java.lang.Object
  |
  +--org.apache.tools.ant.IntrospectionHelper
All Implemented Interfaces:
BuildListener, java.util.EventListener

public class IntrospectionHelper
extends java.lang.Object
implements BuildListener

Helper class that collects the methods a task or nested element holds to set attributes, create nested elements or hold PCDATA elements.

Author:
Stefan Bodewig

Method Summary
 void addText(Project project, java.lang.Object element, java.lang.String text)
          Adds PCDATA areas.
 void buildFinished(BuildEvent event)
          Fired after the last target has finished.
 void buildStarted(BuildEvent event)
          Fired before any targets are started.
 java.lang.Object createElement(Project project, java.lang.Object element, java.lang.String elementName)
          Creates a named nested element.
 java.util.Enumeration getAttributes()
          Return all attribues supported by the introspected class.
 java.lang.Class getAttributeType(java.lang.String attributeName)
          returns the type of a named attribute.
protected  java.lang.String getElementName(Project project, java.lang.Object element)
           
 java.lang.Class getElementType(java.lang.String elementName)
          returns the type of a named nested element.
static IntrospectionHelper getHelper(java.lang.Class c)
          Factory method for helper objects.
 java.util.Enumeration getNestedElements()
          Return all nested elements supported by the introspected class.
 void messageLogged(BuildEvent event)
          Fired whenever a message is logged.
 void setAttribute(Project p, java.lang.Object element, java.lang.String attributeName, java.lang.String value)
          Sets the named attribute.
 void storeElement(Project project, java.lang.Object element, java.lang.Object child, java.lang.String elementName)
          Creates a named nested element.
 boolean supportsCharacters()
          Does the introspected class support PCDATA?
 void targetFinished(BuildEvent event)
          Fired when a target has finished.
 void targetStarted(BuildEvent event)
          Fired when a target is started.
 void taskFinished(BuildEvent event)
          Fired when a task has finished.
 void taskStarted(BuildEvent event)
          Fired when a task is started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHelper

public static IntrospectionHelper getHelper(java.lang.Class c)
Factory method for helper objects.

setAttribute

public void setAttribute(Project p,
                         java.lang.Object element,
                         java.lang.String attributeName,
                         java.lang.String value)
                  throws BuildException
Sets the named attribute.

addText

public void addText(Project project,
                    java.lang.Object element,
                    java.lang.String text)
Adds PCDATA areas.

createElement

public java.lang.Object createElement(Project project,
                                      java.lang.Object element,
                                      java.lang.String elementName)
                               throws BuildException
Creates a named nested element.

storeElement

public void storeElement(Project project,
                         java.lang.Object element,
                         java.lang.Object child,
                         java.lang.String elementName)
                  throws BuildException
Creates a named nested element.

getElementType

public java.lang.Class getElementType(java.lang.String elementName)
                               throws BuildException
returns the type of a named nested element.

getAttributeType

public java.lang.Class getAttributeType(java.lang.String attributeName)
                                 throws BuildException
returns the type of a named attribute.

supportsCharacters

public boolean supportsCharacters()
Does the introspected class support PCDATA?

getAttributes

public java.util.Enumeration getAttributes()
Return all attribues supported by the introspected class.

getNestedElements

public java.util.Enumeration getNestedElements()
Return all nested elements supported by the introspected class.

getElementName

protected java.lang.String getElementName(Project project,
                                          java.lang.Object element)

buildStarted

public void buildStarted(BuildEvent event)
Description copied from interface: BuildListener
Fired before any targets are started.
Specified by:
buildStarted in interface BuildListener

buildFinished

public void buildFinished(BuildEvent event)
Description copied from interface: BuildListener
Fired after the last target has finished. This event will still be thrown if an error occured during the build.
Specified by:
buildFinished in interface BuildListener
Following copied from interface: org.apache.tools.ant.BuildListener
See Also:
BuildEvent.getException()

targetStarted

public void targetStarted(BuildEvent event)
Description copied from interface: BuildListener
Fired when a target is started.
Specified by:
targetStarted in interface BuildListener
Following copied from interface: org.apache.tools.ant.BuildListener
See Also:
BuildEvent.getTarget()

targetFinished

public void targetFinished(BuildEvent event)
Description copied from interface: BuildListener
Fired when a target has finished. This event will still be thrown if an error occured during the build.
Specified by:
targetFinished in interface BuildListener
Following copied from interface: org.apache.tools.ant.BuildListener
See Also:
BuildEvent.getException()

taskStarted

public void taskStarted(BuildEvent event)
Description copied from interface: BuildListener
Fired when a task is started.
Specified by:
taskStarted in interface BuildListener
Following copied from interface: org.apache.tools.ant.BuildListener
See Also:
BuildEvent.getTask()

taskFinished

public void taskFinished(BuildEvent event)
Description copied from interface: BuildListener
Fired when a task has finished. This event will still be throw if an error occured during the build.
Specified by:
taskFinished in interface BuildListener
Following copied from interface: org.apache.tools.ant.BuildListener
See Also:
BuildEvent.getException()

messageLogged

public void messageLogged(BuildEvent event)
Description copied from interface: BuildListener
Fired whenever a message is logged.
Specified by:
messageLogged in interface BuildListener
Following copied from interface: org.apache.tools.ant.BuildListener
See Also:
BuildEvent.getMessage(), BuildEvent.getPriority()


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.