com.im.commons.db
Class SQLWriterRegistry.SQLMessageFormatWriter
java.lang.Object
com.im.commons.db.SQLWriterRegistry.SQLMessageFormatWriter
- All Implemented Interfaces:
- SQLWriter.SQLValueWriter, Serializable
- Enclosing class:
- SQLWriterRegistry
public static class SQLWriterRegistry.SQLMessageFormatWriter
- extends Object
- implements SQLWriter.SQLValueWriter, Serializable
Simple writer that takes a MessageFormat string and passes in the value as {0}/
Useful for spcifying functions. e.g. rawtohex(''{0}'')
Note that single quotes have to be duplicated.
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SQLWriterRegistry.SQLMessageFormatWriter
public SQLWriterRegistry.SQLMessageFormatWriter(String messageFormat)
writeValueToSQL
public String writeValueToSQL(Object value)
- If the value is null then "NULL" is returned (no quotes). Otherwise
generate the formatted value using the MessageFormat with the value
param being passed in as {0}.
- Specified by:
writeValueToSQL in interface SQLWriter.SQLValueWriter
- Parameters:
value - The value to write
- Returns:
- The formatted value or "NULL"