Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.edit.generator.model
Class JMCRPGType

java.lang.Object
  extended by com.ibm.etools.iseries.edit.generator.model.JMCRPGType

public class JMCRPGType
extends Object

A Java representation of an RPG type; Also knows how to generate the string for type defn; Note: RPG arrays are modeled as having isRPGArray() return true (and so its rpg type shows what the element type is) and RPG Objects will have isRPGObject() return true. This implies RPG arrays of objects return true for both isRPGArray() and isRPGObject()


Constructor Summary
JMCRPGType(String displayName, char rpgType, int minLength, int maxLength)
           
JMCRPGType(String displayName, char rpgType, int minLength, int maxLength, boolean varying)
           
JMCRPGType(String displayName, char rpgType, int minLength, int maxLength, boolean varying, JMCRPGType componentType)
           
 
Method Summary
static boolean canAddCONSTKeyword(Class c)
           
 boolean canAddOPTIONSVARSIZEKeyword(int length)
          Is the OPTIONS(*VARSIZE) keyword allowed with this type
static boolean canAddVALUEKeyword(Class c)
          //Maybe it would be better to have a method "canAddKeyword(String kwd)" instead
 Collection genKeywords(int lengthOrDimension, Class thisJavaClass)
          Returns a (possibly empty, but never null) Collection of Strings that are the keywords to be used for this rpg type
 String genRPGTypeCode(int lengthOrDimension, Class thisJavaClass)
          If you have a JMCRPGparameter, simply use its genRPGTypeCode() method; otherwise, use this
 String getDisplayName()
           
 int getMaxLength()
           
 int getMinLength()
           
 boolean isFixedLength()
          Check whether this RPGType's length is fixed by the data type and should not be generated 66109A
 boolean isLengthChangable()
          Check whether this RPGType's length can be changed (same as getMinLength() != getMaxLength())
 boolean isRPGArrayType()
           
 boolean isRPGObjectType()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JMCRPGType

public JMCRPGType(String displayName,
                  char rpgType,
                  int minLength,
                  int maxLength,
                  boolean varying,
                  JMCRPGType componentType)

JMCRPGType

public JMCRPGType(String displayName,
                  char rpgType,
                  int minLength,
                  int maxLength,
                  boolean varying)

JMCRPGType

public JMCRPGType(String displayName,
                  char rpgType,
                  int minLength,
                  int maxLength)
Method Detail

getDisplayName

public String getDisplayName()

genRPGTypeCode

public String genRPGTypeCode(int lengthOrDimension,
                             Class thisJavaClass)
If you have a JMCRPGparameter, simply use its genRPGTypeCode() method; otherwise, use this

Parameters:
lengthOrDimension - The length to use as RPG variable lenght or RPG array dimension. Ignored if isLengthChangable() == false and uses getMaxLength() instead
thisJavaClass - The java class that this represents rpg type
Returns:
String that represents the RPG code when defining a field of that this type represents

genKeywords

public Collection genKeywords(int lengthOrDimension,
                              Class thisJavaClass)
Returns a (possibly empty, but never null) Collection of Strings that are the keywords to be used for this rpg type

Parameters:
lengthOrDimension -
thisJavaClass -
Returns:

getMinLength

public int getMinLength()

getMaxLength

public int getMaxLength()

isLengthChangable

public boolean isLengthChangable()
Check whether this RPGType's length can be changed (same as getMinLength() != getMaxLength())

Returns:

isFixedLength

public boolean isFixedLength()
Check whether this RPGType's length is fixed by the data type and should not be generated 66109A


isRPGObjectType

public boolean isRPGObjectType()
Returns:
true if this represents a RPG Object type; false otherwise

isRPGArrayType

public boolean isRPGArrayType()
Returns:
true if this represents a RPG Array type; false otherwise

canAddCONSTKeyword

public static boolean canAddCONSTKeyword(Class c)
Parameters:
c -
Returns:
negation of canAddVALUEKeyword

canAddVALUEKeyword

public static boolean canAddVALUEKeyword(Class c)
//Maybe it would be better to have a method "canAddKeyword(String kwd)" instead

Parameters:
c -
Returns:
True iff c is a primitive Java type || c is null

canAddOPTIONSVARSIZEKeyword

public boolean canAddOPTIONSVARSIZEKeyword(int length)
Is the OPTIONS(*VARSIZE) keyword allowed with this type

Parameters:
int - length of parameter 66109A

toString

public String toString()
Overrides:
toString in class Object

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.