com.im.commons.db 5.9.2

com.im.commons.db
Class SQLWriterRegistry.SQLMessageFormatWriter

java.lang.Object
  extended by 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

Constructor Summary
SQLWriterRegistry.SQLMessageFormatWriter(String messageFormat)
           
 
Method Summary
 String writeValueToSQL(Object value)
          If the value is null then "NULL" is returned (no quotes).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLWriterRegistry.SQLMessageFormatWriter

public SQLWriterRegistry.SQLMessageFormatWriter(String messageFormat)
Method Detail

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"

com.im.commons.db 5.9.2