Package org.eigenbase.resgen

## Class ResourceGen

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

    public class ResourceGen
    extends java.lang.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
`ResourceGen()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`(package private) void` `comment​(java.lang.String message)` Prints a message to the output stream.
`(package private) FileTask` `createPropertiesTask​(ResourceGenTask.Include include, java.lang.String fileName)`
`(package private) FileTask` `createXmlTask​(ResourceGenTask.Include include, java.lang.String fileName, java.lang.String className, java.lang.String baseClassName, boolean outputJava, java.lang.String cppClassName, java.lang.String cppBaseClassName, boolean outputCpp)`
`(package private) static java.lang.String` `getComment​(ResourceDef.Resource resource)` Returns any comment relating to the message.
`(package private) static java.lang.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​(java.lang.String[] args)`
`(package private) static ResourceGenTask` `parse​(java.lang.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 Detail

#### ResourceGen

    public ResourceGen()

### Method Detail

#### main

    public static void main​(java.lang.String[] args)
                     throws java.io.IOException

Throws:
  `java.io.IOException`

#### parse

    static ResourceGenTask parse​(java.lang.String[] args)

#### run

    void run​(ResourceGenTask rootArgs)
      throws java.io.IOException

Throws:
  `java.io.IOException`

#### comment

    void comment​(java.lang.String message)

Prints a message to the output stream.

#### getResourceInitcap

    static java.lang.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 java.lang.String getComment​(ResourceDef.Resource resource)

Returns any comment relating to the message.

#### createXmlTask

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

#### createPropertiesTask

    FileTask createPropertiesTask​(ResourceGenTask.Include include,
                                  java.lang.String fileName)