|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.sahits.codegen.sql.generator.BasicDataManipulator
public class BasicDataManipulator
This class provides the basic interface for data
manupulation. Using this class the data is not manipulated.
The input data is pased through to the output data.
This class is intended to subclass in the context of the
extension point ch.sahits.codegen.sql.manipulation.
The data maipulator is invoced during the insert script generation.
Database fields that should be convertable must implement the interface
IConvertableField
| Constructor Summary | |
|---|---|
BasicDataManipulator()
Default constructor initializing the record with null |
|
BasicDataManipulator(ICurrentRecordSet record)
Constructor initializing a record |
|
| Method Summary | |
|---|---|
java.lang.String |
convert(java.lang.String fieldName)
Convert the field with the given name. |
java.util.List<IField> |
fields()
Retrieve the list of field value pairs registerd wit this record |
java.lang.String |
getOwner()
This method retrieves the schema of the output data. |
java.lang.String |
getTableName()
This method retrieves the table name of the output data. |
boolean |
hasSchemaAndTableName()
Test if the table name and owner are valid |
boolean |
hasSchemaName()
Test if the owner is valid |
boolean |
hasTableName()
Test if the table name is valid |
protected void |
init()
The init method should be overridden by subclasses to register all the convertors |
void |
registerConverter(java.lang.String fieldName,
IFieldValueConverter converter)
Register a convertor for the field. |
void |
setRecord(ICurrentRecordSet record)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BasicDataManipulator(ICurrentRecordSet record)
record - public BasicDataManipulator()
| Method Detail |
|---|
public final void setRecord(ICurrentRecordSet record)
record - the record to setpublic final java.lang.String getOwner()
public final java.lang.String getTableName()
public final void registerConverter(java.lang.String fieldName,
IFieldValueConverter converter)
...
manipulator.registerConverter("NAME", new IFieldValueConverter(){
// Convert the input to capitalized lowercase
public String convert(Object input) {
String name = (String)input;
name = name.substring(0, 1).toUpperCase()+name.substring(1).toLowerCase();
return name;
}
});
...
fieldName - name of the field to be convertedconverter - instance of a converterpublic final java.util.List<IField> fields()
protected void init()
public final java.lang.String convert(java.lang.String fieldName)
IConvertableField the
original value is returend. If the field is not found null is returned
fieldName - name of the field
public final boolean hasTableName()
public final boolean hasSchemaName()
public final boolean hasSchemaAndTableName()
CurrentRecordSet#hasTableName(),
CurrentRecordSet#hasSchemaName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||