|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--planetj.dataengine.RowClassGenerator
Contains methods for generating a subclass of planetj.database.Row
Method Summary | |
static void |
formatNames(String pName,
StringBuffer pMethodName,
StringBuffer pConstantName)
Formats a name into "Java method" format and "Java constant" format. |
static StringBuffer |
generateConstant(String sqlName,
String constantName,
StringBuffer sb)
Generates a Java code for defining a constant. |
static StringBuffer |
generateConstantComments(FieldDescriptorRow pFd,
StringBuffer pSB)
Generates a Java constant comment |
static StringBuffer |
generateConstantTableProperties(RowClassProperties pProps,
StringBuffer sb)
This method will generate the TABLE_NAME and LIBRARY_NAME constants Creation date: (4/9/2002 1:27:51 PM) |
static StringBuffer |
generateGetter(String columnName,
String constant,
Class fieldType,
boolean usePrimitive,
StringBuffer sb)
Appends to a StringBuffer a String defining a Java method which gets the value of a field |
static String |
generateRowClass(Iterator pFieldDescriptors,
RowClassProperties pProps)
Generates a subclass of the Row class. |
static String |
generateRowClass(RowCollection pRC,
RowClassProperties pProps)
Generates a subclass of the Row class. |
static String |
generateRowClass(Table pTable,
RowClassProperties pProps)
Generates a subclass of the Row class. |
static String |
generateRowInterface(Iterator pFieldDescriptors,
RowInterfaceProperties pProps)
Generates an interface based on a Database Row. |
static String |
generateRowInterface(RowCollection pRC,
RowInterfaceProperties pProps)
Generates an interface based on a Database Row. |
static String |
generateRowInterface(Table pTable,
RowInterfaceProperties pProps)
Generates an interface based on a Database Row. |
static StringBuffer |
generateSetter(String columnName,
String constant,
Class fieldType,
boolean usePrimitive,
String className,
StringBuffer sb)
Appends to a StringBuffer a String defining a Java method which sets the value of a field |
static String |
write(String pClassDef,
RowClassProperties pProps)
Write the generate class/interface file to the fileLocation Creation date: (4/1/2002 6:22:55 PM) |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void formatNames(String pName, StringBuffer pMethodName, StringBuffer pConstantName)
pName
- The name to formatpMethodName
- A StringBuffer which will contain the method fomatted namepConstantName
- A StringBuffer which will contain the constant formatted namepublic static StringBuffer generateConstant(String sqlName, String constantName, StringBuffer sb)
sqlName
- The SQL name of the fieldconstantName
- The name of the constantsb
- The StringBuffer to append the Java code to
public static StringBuffer generateConstantComments(FieldDescriptorRow pFd, StringBuffer pSB) throws CMException
pSB
- A StringBuffer to which the comment will be appendedpFd
- FieldDescriptorRow describing the field.
CMException
public static StringBuffer generateConstantTableProperties(RowClassProperties pProps, StringBuffer sb)
public static StringBuffer generateGetter(String columnName, String constant, Class fieldType, boolean usePrimitive, StringBuffer sb)
columnName
- The name of the column. The method's name will be the String "get" with
this parameter appended on. If the constant
parameter is null, then this value must
be the field's SQL name.constant
- The constant which maps a field's SQL name to a human-formatted name.fieldType
- The type of object the field holdsusePrimitive
- Whether or not the generated method should return a primitive. This parameter is
ignored if there is no primitive type which corresponds to the type of object the field holds.sb
- The StringBuffer to which the method will be appended
public static String generateRowClass(Iterator pFieldDescriptors, RowClassProperties pProps) throws CMException
pFieldDescriptors
- The field descriptors describing the fields which the generated class should
supportpProps
- A RowClassProperties
object containing properties
describing how the class should be genereated.
CMException
public static String generateRowClass(RowCollection pRC, RowClassProperties pProps) throws CMException
pRC
- A RowCollection containg field descriptors which describe the fields the generated class should
supportpProps
- A RowClassProperties
object containing properties
describing how the class should be genereated.
CMException
public static String generateRowClass(Table pTable, RowClassProperties pProps) throws CMException
pTable
- A Table containg field descriptors which describe the fields the generated class should
supportpProps
- A RowClassProperties
object containing properties
describing how the class should be genereated.
CMException
public static String generateRowInterface(Iterator pFieldDescriptors, RowInterfaceProperties pProps) throws CMException
pFieldDescriptors
- The field descriptors describing the fields which the generated class should
supportpProps
- A RowInterfaceProperties
object containing properties
describing how the class should be genereated.
CMException
public static String generateRowInterface(RowCollection pRC, RowInterfaceProperties pProps) throws CMException
pRC
- A RowCollection containg field descriptors which describe the fields the generated class should
supportpProps
- A RowInterfaceProperties
object containing properties
describing how the class should be genereated.
CMException
public static String generateRowInterface(Table pTable, RowInterfaceProperties pProps) throws CMException
pTable
- A Table containg field descriptors which describe the fields the generated class should
supportpProps
- A RowInterfaceProperties
object containing properties
describing how the class should be genereated.
CMException
public static StringBuffer generateSetter(String columnName, String constant, Class fieldType, boolean usePrimitive, String className, StringBuffer sb)
columnName
- The name of the column. The method's name will be the String "get" with
this parameter appended on. If the constant
parameter is null, then this value must
be the field's SQL name.constant
- The constant which maps a field's SQL name to a human-formatted name.usePrimitive
- Whether or not the set method should take in a primitive or an Object. This
parameter is ignored if there is no corresponding primitive type for the field type.className
- The name of the class for which this method is generated. The generated method will
have this type of return value (so it can return "this") as long as this parameter is not null. If this
parameter is null, the generated method will have a return type of void.sb
- The StringBuffer to which the method will be appended
public static String write(String pClassDef, RowClassProperties pProps) throws CMException
CMException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |