Package org.eigenbase.xom

# Class XOMGenTask

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
Modifier and Type
Field
Description
`(package private) String`
`className`
`(package private) String`
`destDir`
`(package private) String`
`dtdFileName`
`(package private) String`
`modelFileName`

## Constructor Summary

Constructors
Constructor
Description
`XOMGenTask()`

## Method Summary

Modifier and Type
Method
Description
`(package private) static File`
`classNameToFile(File dir, String className)`
Creates the File that a java class will live in.
`void`
`execute()`
`void`
`setClassname(String classname)`
See parameter `classname`.
`void`
`setDestdir(String destdir)`
See parameter `destdir`.
`void`
`setDtdname(String dtdname)`
See parameter `dtdname`.
`void`
`setModel(String model)`
See parameter `model`.

## Field Details

### modelFileName

String modelFileName

### destDir

String destDir

### dtdFileName

String dtdFileName

### className

String className

## Constructor Details

### XOMGenTask

public XOMGenTask()

## Method Details

### execute

public void execute() throws BuildException

Throws:
  `BuildException`

### setModel

public void setModel(String model)
See parameter `model`.

### setDestdir

public void setDestdir(String destdir)
See parameter `destdir`.

### setClassname

public void setClassname(String classname)
See parameter `classname`.

### setDtdname

public void setDtdname(String dtdname)
See parameter `dtdname`.

### classNameToFile

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