|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.BaseTypeCompiler
abstract class BaseTypeCompiler
This is the base implementation of TypeCompiler
Field Summary | |
---|---|
private TypeId |
correspondingTypeId
|
Fields inherited from interface org.apache.derby.iapi.sql.compile.TypeCompiler |
---|
AVG_OP, BOOLEAN_MAXWIDTH_AS_CHAR, DEFAULT_DECIMAL_PRECISION, DEFAULT_DECIMAL_SCALE, DIVIDE_OP, DOUBLE_MAXWIDTH_AS_CHAR, INT_MAXWIDTH_AS_CHAR, LONGINT_MAXWIDTH_AS_CHAR, MAX_DECIMAL_PRECISION_SCALE, MINUS_OP, MOD_OP, PLUS_OP, REAL_MAXWIDTH_AS_CHAR, SMALLINT_MAXWIDTH_AS_CHAR, SUM_OP, TIMES_OP, TINYINT_MAXWIDTH_AS_CHAR |
Constructor Summary | |
---|---|
BaseTypeCompiler()
|
Method Summary | |
---|---|
(package private) java.lang.String |
dataValueMethodName()
Return the method name to get a Derby DataValueDescriptor object of the correct type and set it to a specific value. |
void |
generateDataValue(MethodBuilder mb,
int collationType,
LocalField field)
The caller will have pushed a DataValueFactory and value of that can be converted to the correct type, e.g. int for a SQL INTEGER. |
void |
generateNull(MethodBuilder mb,
int collationType)
The caller will have pushed a DataValueFactory and a null or a value of the correct type (interfaceName()). |
java.lang.String |
getPrimitiveMethodName()
Get the method name for getting out the corresponding primitive Java type. |
protected int |
getStoredFormatIdFromTypeId()
Get the StoredFormatId from the corresponding TypeId. |
protected TypeCompiler |
getTypeCompiler(TypeId typeId)
Get the TypeCompiler that corresponds to the given TypeId. |
protected TypeId |
getTypeId()
Get the TypeId that corresponds to this TypeCompiler. |
private static DataValueDescriptor |
gnn(DataValueFactory dvf)
|
private static DataValueDescriptor |
gnn2(DataValueFactory dvf)
|
(package private) abstract java.lang.String |
nullMethodName()
Return the method name to get a Derby DataValueDescriptor object of the correct type set to SQL NULL. |
boolean |
numberConvertible(TypeId otherType,
boolean forDataTypeFunction)
Tell whether this numeric type can be converted to the given type. |
boolean |
numberStorable(TypeId thisType,
TypeId otherType,
ClassFactory cf)
Tell whether this numeric type can be stored into from the given type. |
(package private) boolean |
pushCollationForDataValue(int collationType)
Return true if the collationType is to be passed to the methods generated by generateNull and generateDataValue. |
DataTypeDescriptor |
resolveArithmeticOperation(DataTypeDescriptor leftType,
DataTypeDescriptor rightType,
java.lang.String operator)
Type resolution methods on binary operators |
(package private) void |
setTypeId(TypeId typeId)
Set the TypeCompiler that corresponds to the given TypeId. |
protected boolean |
userTypeStorable(TypeId thisType,
TypeId otherType,
ClassFactory cf)
Determine whether thisType is storable in otherType due to otherType being a user type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.sql.compile.TypeCompiler |
---|
compatible, convertible, getCastToCharWidth, getCorrespondingPrimitiveTypeName, interfaceName, storable |
Field Detail |
---|
private TypeId correspondingTypeId
Constructor Detail |
---|
BaseTypeCompiler()
Method Detail |
---|
public java.lang.String getPrimitiveMethodName()
getPrimitiveMethodName
in interface TypeCompiler
public DataTypeDescriptor resolveArithmeticOperation(DataTypeDescriptor leftType, DataTypeDescriptor rightType, java.lang.String operator) throws StandardException
TypeCompiler
resolveArithmeticOperation
in interface TypeCompiler
leftType
- The type of the left parameterrightType
- The type of the right parameteroperator
- The name of the operator (e.g. "+").
StandardException
- Thrown on errorTypeCompiler.resolveArithmeticOperation(org.apache.derby.iapi.types.DataTypeDescriptor, org.apache.derby.iapi.types.DataTypeDescriptor, java.lang.String)
public void generateNull(MethodBuilder mb, int collationType)
generateNull
in interface TypeCompiler
mb
- The method to put the expression incollationType
- For character DVDs, this will be used to determine
what Collator should be associated with the DVD which in turn will
decide whether to generate CollatorSQLcharDVDs or SQLcharDVDs.TypeCompiler.generateNull(MethodBuilder, int)
public void generateDataValue(MethodBuilder mb, int collationType, LocalField field)
generateDataValue
in interface TypeCompiler
mb
- The method to put the expression incollationType
- For character DVDs, this will be used to determine
what Collator should be associated with the DVD which in turn will
decide whether to generate CollatorSQLcharDVDs or SQLcharDVDs. For
other types of DVDs, this parameter will be ignored.field
- LocalFieldTypeCompiler.generateDataValue(MethodBuilder, int, LocalField)
abstract java.lang.String nullMethodName()
java.lang.String dataValueMethodName()
boolean pushCollationForDataValue(int collationType)
collationType
- Collation type of character values.
protected boolean userTypeStorable(TypeId thisType, TypeId otherType, ClassFactory cf)
thisType
- The TypeId of the value to be storedotherType
- The TypeId of the value to be stored in
public boolean numberConvertible(TypeId otherType, boolean forDataTypeFunction)
otherType
- The TypeId of the other type.forDataTypeFunction
- was this called from a scalarFunction like
CHAR() or DOUBLE()public boolean numberStorable(TypeId thisType, TypeId otherType, ClassFactory cf)
thisType
- The TypeId of this typeotherType
- The TypeId of the other type.cf
- A ClassFactoryprotected TypeId getTypeId()
protected TypeCompiler getTypeCompiler(TypeId typeId)
void setTypeId(TypeId typeId)
protected int getStoredFormatIdFromTypeId()
private static DataValueDescriptor gnn(DataValueFactory dvf)
private static DataValueDescriptor gnn2(DataValueFactory dvf)
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |