net.sourceforge.squirrel_sql.plugins.postgres.types
Class PostgreSqlXmlTypeDataTypeComponent
java.lang.Object
net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BaseDataTypeComponent
net.sourceforge.squirrel_sql.plugins.postgres.types.PostgreSqlXmlTypeDataTypeComponent
- All Implemented Interfaces:
- IDataTypeComponent
public class PostgreSqlXmlTypeDataTypeComponent
- extends BaseDataTypeComponent
- implements IDataTypeComponent
A custom DatatType implementation of IDataTypeComponent that can handle Postgres' xml type (DataType
value of 1111 and type name of 'xml').
- Author:
- manningr
|
Method Summary |
boolean |
areEqual(Object obj1,
Object obj2)
|
boolean |
canDoFileIO()
|
String |
getClassName()
|
Object |
getDefaultValue(String dbDefaultValue)
|
protected KeyListener |
getKeyListener(IRestorableTextComponent component)
|
String |
getWhereClauseValue(Object value,
ISQLDatabaseMetaData md)
|
boolean |
isEditableInCell(Object originalValue)
This Data Type can be edited in a table cell as long as there are no issues displaying the data. |
boolean |
isEditableInPopup(Object originalValue)
This Data Type can be edited in a popup as long as there are no issues displaying the data. |
boolean |
needToReRead(Object originalValue)
|
Object |
readResultSet(ResultSet rs,
int idx,
boolean limitDataRead)
This class relies on reflection to get a handle to Oracle's XMLType which is made available separately
from the JDBC driver, so we cannot just assume the user will always have, nor can we depend on it to
compile SQuirreL code. |
void |
setPreparedStatementValue(PreparedStatement pstmt,
Object value,
int position)
|
boolean |
useBinaryEditingPanel()
|
Object |
validateAndConvert(String value,
Object originalValue,
StringBuffer messageBuffer)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PostgreSqlXmlTypeDataTypeComponent
public PostgreSqlXmlTypeDataTypeComponent()
canDoFileIO
public boolean canDoFileIO()
- Specified by:
canDoFileIO in interface IDataTypeComponent
getClassName
public String getClassName()
- Specified by:
getClassName in interface IDataTypeComponent- Overrides:
getClassName in class BaseDataTypeComponent
- See Also:
IDataTypeComponent.getClassName()
getDefaultValue
public Object getDefaultValue(String dbDefaultValue)
- Specified by:
getDefaultValue in interface IDataTypeComponent
- See Also:
IDataTypeComponent.getDefaultValue(java.lang.String)
getWhereClauseValue
public String getWhereClauseValue(Object value,
ISQLDatabaseMetaData md)
- Specified by:
getWhereClauseValue in interface IDataTypeComponent- Overrides:
getWhereClauseValue in class BaseDataTypeComponent
- See Also:
IDataTypeComponent.getWhereClauseValue(java.lang.Object,
net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData)
isEditableInCell
public boolean isEditableInCell(Object originalValue)
- This Data Type can be edited in a table cell as long as there are no issues displaying the data. If we
detect our error message in the cell, then we should prevent the user from editing the cell (our error
message is not meant to be valid XML data; further, we don't want to let the user whack their data with
our tool accidentally)
- Specified by:
isEditableInCell in interface IDataTypeComponent
- See Also:
IDataTypeComponent.isEditableInCell(java.lang.Object)
isEditableInPopup
public boolean isEditableInPopup(Object originalValue)
- This Data Type can be edited in a popup as long as there are no issues displaying the data. If we
detect our error message in the cell, then we should prevent the user from editing the cell (our error
message is not meant to be valid XML data; further, we don't want to let the user whack their data with
our tool accidentally)
- Specified by:
isEditableInPopup in interface IDataTypeComponent
- See Also:
IDataTypeComponent.isEditableInPopup(java.lang.Object)
needToReRead
public boolean needToReRead(Object originalValue)
- Specified by:
needToReRead in interface IDataTypeComponent
- See Also:
IDataTypeComponent.needToReRead(java.lang.Object)
readResultSet
public Object readResultSet(ResultSet rs,
int idx,
boolean limitDataRead)
throws SQLException
- This class relies on reflection to get a handle to Oracle's XMLType which is made available separately
from the JDBC driver, so we cannot just assume the user will always have, nor can we depend on it to
compile SQuirreL code. So we remove this dependency here by using reflection which doesn't require this
library in order to just compile the code.
- Specified by:
readResultSet in interface IDataTypeComponent
- Throws:
SQLException- See Also:
IDataTypeComponent.readResultSet(java.sql.ResultSet,
int, boolean)
setPreparedStatementValue
public void setPreparedStatementValue(PreparedStatement pstmt,
Object value,
int position)
throws SQLException
- Specified by:
setPreparedStatementValue in interface IDataTypeComponent
- Throws:
SQLException- See Also:
IDataTypeComponent.setPreparedStatementValue(java.sql.PreparedStatement,
java.lang.Object, int)
useBinaryEditingPanel
public boolean useBinaryEditingPanel()
- Specified by:
useBinaryEditingPanel in interface IDataTypeComponent
- See Also:
IDataTypeComponent.useBinaryEditingPanel()
areEqual
public boolean areEqual(Object obj1,
Object obj2)
- Specified by:
areEqual in interface IDataTypeComponent- Overrides:
areEqual in class BaseDataTypeComponent
- See Also:
IDataTypeComponent.areEqual(java.lang.Object,
java.lang.Object)
validateAndConvert
public Object validateAndConvert(String value,
Object originalValue,
StringBuffer messageBuffer)
- Specified by:
validateAndConvert in interface IDataTypeComponent- Overrides:
validateAndConvert in class BaseDataTypeComponent
- See Also:
BaseDataTypeComponent.validateAndConvert(java.lang.String, java.lang.Object, java.lang.StringBuffer)
getKeyListener
protected KeyListener getKeyListener(IRestorableTextComponent component)
- Overrides:
getKeyListener in class BaseDataTypeComponent
- See Also:
BaseDataTypeComponent.getKeyListener(IRestorableTextComponent)
Copyright © 2001-2010. All Rights Reserved.