org.eigenbase.resgen
Class AbstractJavaGenerator

java.lang.Object
  extended by org.eigenbase.resgen.AbstractGenerator
      extended by 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
Author:
jhyde
 

Field Summary
protected  String baseClassName
           
protected  String className
           
protected  ResourceDef.ResourceBundle resourceBundle
           
 
Constructor Summary
AbstractJavaGenerator(File srcFile, File file, String className, ResourceDef.ResourceBundle resourceBundle, String baseClassName)
           
 
Method Summary
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 Detail

className

protected final String className

resourceBundle

protected final ResourceDef.ResourceBundle resourceBundle

baseClassName

protected final String baseClassName
Constructor Detail

AbstractJavaGenerator

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

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

SourceForge.net_Logo