org.apache.tools.ant.helper

Class ProjectHelper2



  • public class ProjectHelper2
    extends ProjectHelper
    Sax2 based project reader
    • Field Detail

      • REFID_TARGETS

        public static final java.lang.String REFID_TARGETS
        Reference holding the (ordered) target Vector
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProjectHelper2

        public ProjectHelper2()
    • Method Detail

      • canParseAntlibDescriptor

        public boolean canParseAntlibDescriptor(Resource resource)
        Whether this instance of ProjectHelper can parse an Antlib descriptor given by the URL and return its content as an UnknownElement ready to be turned into an Antlib task.

        This implementation returns true.

        Overrides:
        canParseAntlibDescriptor in class ProjectHelper
        Parameters:
        resource - Resource
        Returns:
        boolean
        Since:
        Ant 1.8.0
      • parseAntlibDescriptor

        public UnknownElement parseAntlibDescriptor(Project containingProject,
                                                    Resource resource)
        Parse the given URL as an antlib descriptor and return the content as something that can be turned into an Antlib task.

        simply delegates to parseUnknownElement if the resource provides an URL and throws an exception otherwise.

        Overrides:
        parseAntlibDescriptor in class ProjectHelper
        Parameters:
        containingProject - Project
        resource - Resource
        Returns:
        UnknownElement
        Since:
        Ant 1.8.0
      • parseUnknownElement

        public UnknownElement parseUnknownElement(Project project,
                                                  java.net.URL source)
                                           throws BuildException
        Parse an unknown element from a url
        Parameters:
        project - the current project
        source - the url containing the task
        Returns:
        a configured task
        Throws:
        BuildException - if an error occurs
      • parse

        public void parse(Project project,
                          java.lang.Object source)
                   throws BuildException
        Parse a source xml input.
        Overrides:
        parse in class ProjectHelper
        Parameters:
        project - the current project
        source - the xml source
        Throws:
        BuildException - if an error occurs
      • parse

        public void parse(Project project,
                          java.lang.Object source,
                          ProjectHelper2.RootHandler handler)
                   throws BuildException
        Parses the project file, configuring the project as it goes.
        Parameters:
        project - the current project
        source - the xml source
        handler - the root handler to use (contains the current context)
        Throws:
        BuildException - if the configuration is invalid or cannot be read
      • setMainHandler

        protected static void setMainHandler(ProjectHelper2.AntHandler handler)
        Sets main handler
        Parameters:
        handler - new main handler
      • getProjectHandler

        protected static ProjectHelper2.AntHandler getProjectHandler()
        Returns project handler
        Returns:
        project handler
      • setProjectHandler

        protected static void setProjectHandler(ProjectHelper2.AntHandler handler)
        Sets project handler
        Parameters:
        handler - new project handler
      • getTargetHandler

        protected static ProjectHelper2.AntHandler getTargetHandler()
        Returns target handler
        Returns:
        target handler
      • setTargetHandler

        protected static void setTargetHandler(ProjectHelper2.AntHandler handler)
        Sets target handler
        Parameters:
        handler - new target handler
      • getElementHandler

        protected static ProjectHelper2.AntHandler getElementHandler()
        Returns element handler
        Returns:
        element handler
      • setElementHandler

        protected static void setElementHandler(ProjectHelper2.AntHandler handler)
        Sets element handler
        Parameters:
        handler - new element handler