com.ibm.jzos.recordgen.asm
Class RecordClassGenerator

java.lang.Object
  extended by com.ibm.jzos.recordgen.asm.RecordClassGenerator

public class RecordClassGenerator
extends java.lang.Object

Generates the source code for a Java class that maps a byte array matching the description given by an Assembler CSECT or DSECT. The input to this process is an ADATA file created by the IBM High-level Assembler.

See the sample JCL member "DSECTGEN" for example JCL for executing the assembler and converting the ADATA output to a Java source file.

See Also:
for information on running this class

Constructor Summary
RecordClassGenerator(RecordSpec recordSpec)
          Construct an instance with a given RecordSpec
 
Method Summary
protected  void genConstant(ConstantSpec constantSpec)
           
protected  void genConstructors()
           
 void generateJavaSourceOn(java.io.Writer writer)
          Generate Java source to the given Writer.
protected  void genHeader()
           
protected  void genInstanceVariable(FieldSpec fieldSpec)
           
protected  void genInstanceVariables()
           
protected  void genSettersAndGetter(FieldSpec fieldSpec)
           
protected  void genSettersAndGetters()
           
protected  void genSourceLineComments(ElementSpec spec)
           
protected  void genStaticFieldDeclaration(java.lang.String javaName, FieldSpec fieldSpec)
           
protected  void genStaticFieldLayout()
           
protected  void genStaticFieldLayout(FieldSpec fieldSpec)
           
protected  void genTrailer()
           
 java.lang.String getClassName()
          Answer the unqualified Java class name that is generated
protected  java.lang.String getInstanceJavaName(java.lang.String label, int index, boolean upperFirst)
           
 java.lang.String getPackageName()
          Answer the Java package name for the generated Class.
protected  java.lang.String getStaticJavaName(java.lang.String label, int index)
           
 boolean isGenSetters()
          Answer whether Java "set" methods should be generated for generated fields.
 boolean isUseBufOffset()
          Answer whether generated Java source code will include buffer offsets into the underlying byte array.
static void main(java.lang.String[] args)
          Main method / driver for generating Java Classes from Assembler ADATA files.
 void setClassName(java.lang.String className)
           
 void setGenSetters(boolean genSetters)
           
 void setPackageName(java.lang.String packageName)
           
 void setUseBufOffset(boolean useBufOffset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordClassGenerator

public RecordClassGenerator(RecordSpec recordSpec)
Construct an instance with a given RecordSpec

Parameters:
recordSpec - the RecordSpec
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Main method / driver for generating Java Classes from Assembler ADATA files. Java source code is written to System.out.

Arguments consist of the following optional "name=value" pairs:

Parameters:
args - key=value strings as described above.
Throws:
java.io.IOException

generateJavaSourceOn

public void generateJavaSourceOn(java.io.Writer writer)
                          throws java.io.IOException
Generate Java source to the given Writer.

Parameters:
writer -
Throws:
java.io.IOException

getClassName

public java.lang.String getClassName()
Answer the unqualified Java class name that is generated

Returns:
String

setClassName

public void setClassName(java.lang.String className)
See Also:
Object.getClass()

getPackageName

public java.lang.String getPackageName()
Answer the Java package name for the generated Class.

Returns:
String

setPackageName

public void setPackageName(java.lang.String packageName)
See Also:
getPackageName()

isGenSetters

public boolean isGenSetters()
Answer whether Java "set" methods should be generated for generated fields.

Returns:
boolean

setGenSetters

public void setGenSetters(boolean genSetters)
See Also:
isGenSetters()

isUseBufOffset

public boolean isUseBufOffset()
Answer whether generated Java source code will include buffer offsets into the underlying byte array.

Returns:
boolean

setUseBufOffset

public void setUseBufOffset(boolean useBufOffset)
See Also:
isUseBufOffset()

genConstant

protected void genConstant(ConstantSpec constantSpec)
                    throws java.io.IOException
Throws:
java.io.IOException

genConstructors

protected void genConstructors()
                        throws java.io.IOException
Throws:
java.io.IOException

genHeader

protected void genHeader()
                  throws java.io.IOException
Throws:
java.io.IOException

genInstanceVariable

protected void genInstanceVariable(FieldSpec fieldSpec)
                            throws java.io.IOException
Throws:
java.io.IOException

genInstanceVariables

protected void genInstanceVariables()
                             throws java.io.IOException
Throws:
java.io.IOException

genSettersAndGetter

protected void genSettersAndGetter(FieldSpec fieldSpec)
                            throws java.io.IOException
Throws:
java.io.IOException

genSettersAndGetters

protected void genSettersAndGetters()
                             throws java.io.IOException
Throws:
java.io.IOException

genSourceLineComments

protected void genSourceLineComments(ElementSpec spec)
                              throws java.io.IOException
Throws:
java.io.IOException

genStaticFieldDeclaration

protected void genStaticFieldDeclaration(java.lang.String javaName,
                                         FieldSpec fieldSpec)
                                  throws java.io.IOException
Throws:
java.io.IOException

genStaticFieldLayout

protected void genStaticFieldLayout()
                             throws java.io.IOException
Throws:
java.io.IOException

genStaticFieldLayout

protected void genStaticFieldLayout(FieldSpec fieldSpec)
                             throws java.io.IOException
Throws:
java.io.IOException

genTrailer

protected void genTrailer()
                   throws java.io.IOException
Throws:
java.io.IOException

getInstanceJavaName

protected java.lang.String getInstanceJavaName(java.lang.String label,
                                               int index,
                                               boolean upperFirst)

getStaticJavaName

protected java.lang.String getStaticJavaName(java.lang.String label,
                                             int index)