Package com.im.commons.db
Class SQLWriterRegistry.SQLMessageFormatWriter
- java.lang.Object
-
- com.im.commons.db.SQLWriterRegistry.SQLMessageFormatWriter
-
- All Implemented Interfaces:
SQLWriter.SQLValueWriter
,java.io.Serializable
- Enclosing class:
- SQLWriterRegistry
public static final class SQLWriterRegistry.SQLMessageFormatWriter extends java.lang.Object implements SQLWriter.SQLValueWriter, java.io.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
-
-
Constructor Summary
Constructors Constructor Description SQLMessageFormatWriter(java.lang.String messageFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
writeValueToSQL(java.lang.Object value)
If the value is null then "NULL" is returned (no quotes).
-
-
-
Method Detail
-
writeValueToSQL
public java.lang.String writeValueToSQL(java.lang.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 interfaceSQLWriter.SQLValueWriter
- Parameters:
value
- The value to write- Returns:
- The formatted value or "NULL"
-
-