olg.csv.bean.annotations.processor
Class FormatterProcessor

java.lang.Object
  extended by olg.csv.bean.annotations.processor.FormatterProcessor

public final class FormatterProcessor
extends Object

This class is responsible for processing the @Formatter annotation.

Author:
Olivier Godineau

Method Summary
<T> Formatter<T>
getFormatter(Field field, Class<T> fieldConcreteClass)
          Return the formatter to use on a field.
static FormatterProcessor getInstance()
          The singleton instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static FormatterProcessor getInstance()
The singleton instance.

Returns:
the singleton instance

getFormatter

public <T> Formatter<T> getFormatter(Field field,
                                     Class<T> fieldConcreteClass)
                          throws AnnotationProcessorException
Return the formatter to use on a field. If no formatter annotation is setted on the field, a default formatter is returned (use the toString method of the concrete class)

Type Parameters:
T - the type the formatter deals with.
Parameters:
field - the field to format
fieldConcreteClass - the concrete class
Returns:
the formatter
Throws:
AnnotationProcessorException - if an error occurs


Copyright © 2014. All rights reserved.