Package jflex.anttask

Class JFlexTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
jflex.anttask.JFlexTask
All Implemented Interfaces:
Cloneable

public class JFlexTask extends org.apache.tools.ant.Task
JFlex ant task.
Version:
JFlex 1.8.2
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Pattern
     
    private String
     
    private File
    for javac-like dest dir behaviour
    private File
     
    private File
    the actual output directory (outputDir = destinationDir + package))
    private static final Pattern
     
    private String
     

    Fields inherited from class org.apache.tools.ant.Task

    target, taskName, taskType, wrapper

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for JFlexTask.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes the ant task.
    void
    Peek into .flex file to get package and class name
    Getter for the field className.
    getPackage.
    void
    Sets the actual output directory if not already set.
    void
    setDestdir(File destinationDir)
    setDestdir.
    void
    setDot(boolean b)
    setDot.
    void
    setDump(boolean b)
    setDump.
    void
    setEncoding(String encodingName)
    Set the input encoding.
    void
    setFile(File file)
    setFile.
    void
    setGenerateDot(boolean genDot)
    setGenerateDot.
    void
    setJLex(boolean b)
    setJLex.
    void
    setLegacyDot(boolean b)
    setLegacyDot.
    void
    setNobak(boolean b)
    setNobak.
    void
    setNomin(boolean b)
    setNomin.
    void
    setOutdir(File outDir)
    setOutdir.
    void
    setPack(boolean b)
    setPack.
    void
    setSkel(File skeleton)
    setSkel.
    void
    setSkeleton(File skeleton)
    setSkeleton.
    void
    setSkipMinimization(boolean skipMin)
    setSkipMinimization.
    void
    setTime(boolean displayTime)
    setTime.
    void
    setTimeStatistics(boolean displayTime)
    setTimeStatistics.
    final void
    setUnusedWarning(boolean warn)
    setUnusedWarning.
    final void
    setVerbose(boolean verbose)
    setVerbose.

    Methods inherited from class org.apache.tools.ant.Task

    bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

    Methods inherited from class org.apache.tools.ant.ProjectComponent

    clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PACKAGE_PATTERN

      private static final Pattern PACKAGE_PATTERN
    • CLASS_PATTERN

      private static final Pattern CLASS_PATTERN
    • inputFile

      private File inputFile
    • className

      private String className
    • packageName

      private String packageName
    • destinationDir

      private File destinationDir
      for javac-like dest dir behaviour
    • outputDir

      private File outputDir
      the actual output directory (outputDir = destinationDir + package))
  • Constructor Details

    • JFlexTask

      public JFlexTask()
      Constructor for JFlexTask.
  • Method Details

    • execute

      public void execute()
      Executes the ant task.
      Overrides:
      execute in class org.apache.tools.ant.Task
      Throws:
      org.apache.tools.ant.BuildException - if any.
    • findPackageAndClass

      public void findPackageAndClass() throws IOException
      Peek into .flex file to get package and class name
      Throws:
      IOException - if there is a problem reading the .flex file
    • normalizeOutdir

      public void normalizeOutdir()
      Sets the actual output directory if not already set.

      Uses javac logic to determine output dir = dest dir + package name If not destdir has been set, output dir = parent of input file

      Assumes that package name is already set.

    • getPackage

      public String getPackage()
      getPackage.
      Returns:
      package name of input file
      See Also:
    • getClassName

      public String getClassName()
      Getter for the field className.
      Returns:
      class name of input file
      See Also:
    • setDestdir

      public void setDestdir(File destinationDir)
      setDestdir.
      Parameters:
      destinationDir - a File object.
    • setOutdir

      public void setOutdir(File outDir)
      setOutdir.
      Parameters:
      outDir - a File object.
    • setFile

      public void setFile(File file)
      setFile.
      Parameters:
      file - a File object.
    • setGenerateDot

      public void setGenerateDot(boolean genDot)
      setGenerateDot.
      Parameters:
      genDot - a boolean.
    • setTimeStatistics

      public void setTimeStatistics(boolean displayTime)
      setTimeStatistics.
      Parameters:
      displayTime - a boolean.
    • setTime

      public void setTime(boolean displayTime)
      setTime.
      Parameters:
      displayTime - a boolean.
    • setVerbose

      public final void setVerbose(boolean verbose)
      setVerbose.
      Parameters:
      verbose - a boolean.
    • setUnusedWarning

      public final void setUnusedWarning(boolean warn)
      setUnusedWarning.
      Parameters:
      warn - a boolean.
    • setSkeleton

      public void setSkeleton(File skeleton)
      setSkeleton.
      Parameters:
      skeleton - a File object.
    • setSkel

      public void setSkel(File skeleton)
      setSkel.
      Parameters:
      skeleton - a File object.
    • setSkipMinimization

      public void setSkipMinimization(boolean skipMin)
      setSkipMinimization.
      Parameters:
      skipMin - a boolean.
    • setNomin

      public void setNomin(boolean b)
      setNomin.
      Parameters:
      b - a boolean.
    • setNobak

      public void setNobak(boolean b)
      setNobak.
      Parameters:
      b - a boolean.
    • setPack

      public void setPack(boolean b)
      setPack.
      Parameters:
      b - a boolean.
    • setDot

      public void setDot(boolean b)
      setDot.
      Parameters:
      b - a boolean.
    • setDump

      public void setDump(boolean b)
      setDump.
      Parameters:
      b - a boolean.
    • setJLex

      public void setJLex(boolean b)
      setJLex.
      Parameters:
      b - a boolean.
    • setLegacyDot

      public void setLegacyDot(boolean b)
      setLegacyDot.
      Parameters:
      b - a boolean.
    • setEncoding

      public void setEncoding(String encodingName)
      Set the input encoding. If unset will use the JVM default.
      Parameters:
      encodingName - the name of the encoding to set (e.g. "utf-8").