Package org.eigenbase.xom

## Class XOMGenTask

- java.lang.Object
- - Task
  - - org.eigenbase.xom.XOMGenTask

    public class XOMGenTask
    extends Task

`XOMGenTask` is an ANT task with which to invoke `MetaGenerator`.

Since:
  1 April, 2002
Version:
  $Id: //open/util/resgen/src/org/eigenbase/xom/XOMGenTask.java#4 $

  ## XOMGen

  ### Description

  Invokes the `MetaGenerator`.

  This task only invokes XOMGen if the grammar file is newer than the generated Java files.

  ### Parameters

  Attribute | Description | Required
  model | The name of the XML file which holds the XOM model. | Yes
  destdir | The name of the output directory. Default is the current directory. | No
  classname | The full name of the class to generate. | Yes
  dtdname | The name of the DTD file to generate. The path may be either absolute, or relative to `destdir`. | Yes

  ### Example

  >     <xomgen
  >          model="src/org/eigenbase/xom/Meta.xml"
  >          destdir="src"
  >          classname="org.eigenbase.xom.MetaDef"/>

  This invokes XOMGen on the model file `src/org/eigenbase/xom/Meta.xml`, and generates `src/org/eigenbase/xom/MetaDef.java` and `src/org/eigenbase/xom/meta.dtd`.

Author:
  jhyde

### Field Summary

Fields
`(package private) java.lang.String` `className`
`(package private) java.lang.String` `destDir`
`(package private) java.lang.String` `dtdFileName`
`(package private) java.lang.String` `modelFileName`

### Constructor Summary

Constructors
`XOMGenTask()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`(package private) static java.io.File` `classNameToFile​(java.io.File dir, java.lang.String className)` Creates the File that a java class will live in.
`void` `execute()`
`void` `setClassname​(java.lang.String classname)` See parameter `classname`.
`void` `setDestdir​(java.lang.String destdir)` See parameter `destdir`.
`void` `setDtdname​(java.lang.String dtdname)` See parameter `dtdname`.
`void` `setModel​(java.lang.String model)` See parameter `model`.

### Methods inherited from class java.lang.Object

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

### Field Detail

#### modelFileName

    java.lang.String modelFileName

#### destDir

    java.lang.String destDir

#### dtdFileName

    java.lang.String dtdFileName

#### className

    java.lang.String className

### Constructor Detail

#### XOMGenTask

    public XOMGenTask()

### Method Detail

#### execute

    public void execute()
                 throws BuildException

Throws:
  `BuildException`

#### setModel

    public void setModel​(java.lang.String model)

See parameter `model`.

#### setDestdir

    public void setDestdir​(java.lang.String destdir)

See parameter `destdir`.

#### setClassname

    public void setClassname​(java.lang.String classname)

See parameter `classname`.

#### setDtdname

    public void setDtdname​(java.lang.String dtdname)

See parameter `dtdname`.

#### classNameToFile

    static java.io.File classNameToFile​(java.io.File dir,
                                        java.lang.String className)

Creates the File that a java class will live in. For example, `makeJavaFileName("com.myproj", "MyClass")` returns "com/myproj/MyClass.java".