Version: 0.1

org.apache.tools.ant.taskdefs.optional.javarec
Class RecordTypeTask

org.apache.tools.ant.taskdefs.optional.javarec.RecordTypeTask

public class RecordTypeTask

Generate a Cobol record type from a Cobol copy book. This Ant task calls the CobolImport command to create RecordType classes from a Cobol copy book. There are no nested tags for this task - only attributes.

Parameters

AttributeDescriptionRequired
targetDir The directory into which record type source will be generated. Yes
pkgName The package in which to place the record type class. Yes
className The name of the record type class. Yes
ccpfile The name of the file containing the Cobol copy book. Yes
commarea The names of the definition records for the COMMAREAs contained in the Cobol copy book file. Each name in the string is separated by a colon. The default is DFHCOMMAREA. No
nocics If nocics is true, the commarea is not required. Otherwise it is assumed that the record type is intended for a CICS transaction, which is the default behavior. No
genold If set to true, use a Java double to represent decimals. Otherwise use Java java.math.BigDecimal. The default is false. No

Examples

In the following example, the copy book is stored in a file named CustSearch.ccp. The record type class will be named CustSearchRecordType and be placed in the file src/com/yourfirm/record/CustSearchRecordType.

 <mkdir dir="src/com/yourfirm/record"/>
 <generated-record-type targetDir="src"
                           pkgName="com.yourfirm.record"
                           className="CustSearchRecordType"
                           ccpfile="CustSearch.ccp"/>
 
The creation of the directory for CustSearchRecordType before hand was necessary for the EAB command line tool to completel successfully.

Author:
Paul Glezen

Field Summary
static java.lang.String DEFAULT_COMMAREA
          Default copy book section - currently set to DFHCOMMAREA.
static java.lang.String RECORD_TYPE_GENERATOR
          The fully qualified class name of the record type generating currently set to com.ibm.ivj.eab.record.importer.gentype.cobol.CobolImport.
 
Constructor Summary
RecordTypeTask()
           
 
Method Summary
protected  void checkRequiredParams()
          Check that the required parameters are present.
 void execute()
          Perform the invocation of the EAB command to generate the record type from a Cobol copy book.
 void setCcpfile(java.io.File file)
          Set the file containing the Cobol copy book source.
 void setClassName(java.lang.String name)
          Set the class name for the generated record type.
 void setCommarea(java.lang.String name)
          Set the COMMAREA section of the copy book to be used for for record type generation.
 void setGenold(boolean genold)
          If set to true, a Java double is used to represent decimals.
 void setNocics(boolean nocics)
          Set this property to true when your EIS is not a CICS system (IMS, for example).
 void setPkgName(java.lang.String name)
          Set the package for the generated record type class.
 void setTargetDir(java.io.File dir)
          Set the target directory of the generated source file's package hierarchy.
 

Field Detail

DEFAULT_COMMAREA

public static final java.lang.String DEFAULT_COMMAREA
Default copy book section - currently set to DFHCOMMAREA.

RECORD_TYPE_GENERATOR

public static final java.lang.String RECORD_TYPE_GENERATOR
The fully qualified class name of the record type generating currently set to com.ibm.ivj.eab.record.importer.gentype.cobol.CobolImport.
Constructor Detail

RecordTypeTask

public RecordTypeTask()
Method Detail

setTargetDir

public void setTargetDir(java.io.File dir)
Set the target directory of the generated source file's package hierarchy.

setCcpfile

public void setCcpfile(java.io.File file)
Set the file containing the Cobol copy book source.

setPkgName

public void setPkgName(java.lang.String name)
Set the package for the generated record type class.

setClassName

public void setClassName(java.lang.String name)
Set the class name for the generated record type.

setCommarea

public void setCommarea(java.lang.String name)
Set the COMMAREA section of the copy book to be used for for record type generation. If it is necessary to specify a hierarchy of names, these should be separated by colons.

setNocics

public void setNocics(boolean nocics)
Set this property to true when your EIS is not a CICS system (IMS, for example). The default is true (CICS is assumed.)

setGenold

public void setGenold(boolean genold)
If set to true, a Java double is used to represent decimals. Otherwise java.math.BigDecimal is used. The default is false.

checkRequiredParams

protected void checkRequiredParams()
                            throws org.apache.tools.ant.BuildException
Check that the required parameters are present.

Throws:
org.apache.tools.ant.BuildException - if one of the required parameters if found to be missing.

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Perform the invocation of the EAB command to generate the record type from a Cobol copy book.

Throws:
org.apache.tools.ant.BuildException - if a non-zero return code results or an java.io.IOException is thrown (because of process creation failure).

Version: 0.1

Paul Glezen
pglezen@us.ibm.com