Class FormatValueFilter

  • All Implemented Interfaces:
    ValueFilter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware

    public class FormatValueFilter
    extends java.lang.Object
    implements ValueFilter, org.springframework.beans.factory.BeanFactoryAware
    Convert An Object or collection of Objects to a formatted String or collection of Strings based on the Bean ID from the the format parameter which should be an instance of java.text.format
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object doFilter​(IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value)  
      protected java.lang.Object formatValue​(IndexerBatchContext batchContext, IndexedProperty indexedProperty, java.lang.Object value)
      Convert An Object to a formatted String based on the Bean ID from the the format parameter whcih should be an instance of java.text.format
      protected java.text.Format getValueFormatter​(java.lang.String formatterBeanName)  
      void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FORMAT_PARAM_DEFAULT_VALUE

        public static final java.lang.String FORMAT_PARAM_DEFAULT_VALUE
    • Constructor Detail

      • FormatValueFilter

        public FormatValueFilter()
    • Method Detail

      • setBeanFactory

        public void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)
        Specified by:
        setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      • getValueFormatter

        protected java.text.Format getValueFormatter​(java.lang.String formatterBeanName)
      • doFilter

        public java.lang.Object doFilter​(IndexerBatchContext batchContext,
                                         IndexedProperty indexedProperty,
                                         java.lang.Object value)
        Specified by:
        doFilter in interface ValueFilter
        Parameters:
        batchContext - - The Batch context
        indexedProperty - - The indexed properties that should contains the Bean Id of the formatter bean
        value - - The Object or collection of Objects to be formatted
        Returns:
        formatted Object or collection of formatted Object
      • formatValue

        protected java.lang.Object formatValue​(IndexerBatchContext batchContext,
                                               IndexedProperty indexedProperty,
                                               java.lang.Object value)
        Convert An Object to a formatted String based on the Bean ID from the the format parameter whcih should be an instance of java.text.format
        Parameters:
        batchContext - - The Batch context
        indexedProperty - - The indexed properties that should contains the Bean Id of the formatter bean
        value - - The Object to be formatted
        Returns:
        String Object with the formatted value