Package org.eigenbase.resgen

# Class AbstractJavaGenerator

java.lang.Object
org.eigenbase.resgen.AbstractGenerator
org.eigenbase.resgen.AbstractJavaGenerator

All Implemented Interfaces:
  `Generator`

Direct Known Subclasses:
  `JavaBaseGenerator`, `JavaLocaleGenerator`

abstract class AbstractJavaGenerator extends AbstractGenerator
Abstract base for all generators which generate Java code.

Since:
  19 September, 2005
Version:
  $Id: //open/util/resgen/src/org/eigenbase/resgen/AbstractJavaGenerator.java#3 $
Author:
  jhyde

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final String`
`baseClassName`
`protected final String`
`className`
`protected final ResourceDef.ResourceBundle`
`resourceBundle`

## Constructor Summary

Constructors
Constructor
Description
`AbstractJavaGenerator(File srcFile, File file, String className, ResourceDef.ResourceBundle resourceBundle, String baseClassName)`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`generateFooter(PrintWriter pw, String className)`
`protected void`
`generateHeader(PrintWriter pw)`
`protected String[]`
`getArgTypes(String message)`
Returns the number and types of parameters in the given error message, expressed as an array of Strings (legal values are currently "String", "Number", "java.util.Date", and null) ordered by parameter number.
`protected String`
`getBaseClassName()`
Returns the fully-qualified name of the base class.
`protected String`
`getClassName()`
Returns the fully-qualified name of the class being generated, for example "happy.BirthdayResource_en_US".
`protected String`
`getErrorClass(ResourceDef.Exception exception)`
Returns the type of error which is to be thrown by this resource.
`protected String`
`getPackageName()`

### Methods inherited from class org.eigenbase.resgen.AbstractGenerator

`generateDoNotModifyHeader, generateGeneratedByBlock, generateResource, getArgumentList, getFile, getParameterList, getSrcFileForComment, setScmSafeComments, useScmSafeComments`

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

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

### Methods inherited from interface org.eigenbase.resgen.Generator

`generateModule`

## Field Details

### className

protected final String className

### resourceBundle

protected final ResourceDef.ResourceBundle resourceBundle

### baseClassName

protected final String baseClassName

## Constructor Details

### AbstractJavaGenerator

AbstractJavaGenerator(File srcFile, File file, String className, ResourceDef.ResourceBundle resourceBundle, String baseClassName)

## Method Details

### getErrorClass

protected String getErrorClass(ResourceDef.Exception exception)
Returns the type of error which is to be thrown by this resource. Result is null if this is not an error.

### getPackageName

protected String getPackageName()

### getArgTypes

protected String[] getArgTypes(String message)
Description copied from class: `AbstractGenerator`
Returns the number and types of parameters in the given error message, expressed as an array of Strings (legal values are currently "String", "Number", "java.util.Date", and null) ordered by parameter number.

Specified by:
  `getArgTypes` in class `AbstractGenerator`

### generateHeader

protected void generateHeader(PrintWriter pw)

### generateFooter

protected void generateFooter(PrintWriter pw, String className)

### getClassName

protected String getClassName()
Description copied from class: `AbstractGenerator`
Returns the fully-qualified name of the class being generated, for example "happy.BirthdayResource_en_US".

Specified by:
  `getClassName` in class `AbstractGenerator`

### getBaseClassName

protected String getBaseClassName()
Description copied from class: `AbstractGenerator`
Returns the fully-qualified name of the base class.

Specified by:
  `getBaseClassName` in class `AbstractGenerator`