Package org.eigenbase.resgen

# Class ResourceGen

java.lang.Object
org.eigenbase.resgen.ResourceGen

public class ResourceGen extends Object
`ResourceGen` parses an XML file containing error messages, and generates .java file to access the errors. Usage:

>     ResourceGen xmlFile

For example,

>     java org.eigenbase.resgen.ResourceGen MyResource_en.xml

This will create class `MyResource`, with a function corresponding to each error message in `MyResource_en.xml`.

See also the ANT Task, `ResourceGenTask`.

Since:
  3 December, 2001
Version:
  $Id: //open/util/resgen/src/org/eigenbase/resgen/ResourceGen.java#7 $
Author:
  jhyde

## Constructor Summary

Constructors
Constructor
Description
`ResourceGen()`

## Method Summary

Modifier and Type
Method
Description
`(package private) void`
`comment(String message)`
Prints a message to the output stream.
`(package private) FileTask`
`createPropertiesTask(ResourceGenTask.Include include, String fileName)`
`(package private) FileTask`
`createXmlTask(ResourceGenTask.Include include, String fileName, String className, String baseClassName, boolean outputJava, String cppClassName, String cppBaseClassName, boolean outputCpp)`
`(package private) static String`
`getComment(ResourceDef.Resource resource)`
Returns any comment relating to the message.
`(package private) static String`
`getResourceInitcap(ResourceDef.Resource resource)`
Returns the name of the resource with the first letter capitalized, suitable for use in method names.
`static void`
`main(String[] args)`
`(package private) static ResourceGenTask`
`parse(String[] args)`
`(package private) void`
`run(ResourceGenTask rootArgs)`

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

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

## Constructor Details

### ResourceGen

public ResourceGen()

## Method Details

### main

public static void main(String[] args) throws IOException

Throws:
  `IOException`

### parse

static ResourceGenTask parse(String[] args)

### run

void run(ResourceGenTask rootArgs) throws IOException

Throws:
  `IOException`

### comment

void comment(String message)
Prints a message to the output stream.

### getResourceInitcap

static String getResourceInitcap(ResourceDef.Resource resource)
Returns the name of the resource with the first letter capitalized, suitable for use in method names. For example, "MyErrorMessage".

### getComment

static String getComment(ResourceDef.Resource resource)
Returns any comment relating to the message.

### createXmlTask

FileTask createXmlTask(ResourceGenTask.Include include, String fileName, String className, String baseClassName, boolean outputJava, String cppClassName, String cppBaseClassName, boolean outputCpp)

### createPropertiesTask

FileTask createPropertiesTask(ResourceGenTask.Include include, String fileName)