olg.csv.bean.annotations.processor
Class ParserProcessor

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

public final class ParserProcessor
extends Object

This class is responsible for processing the @Parser annotation.

Author:
Olivier Godineau

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

Method Detail

getInstance

public static ParserProcessor getInstance()
The singleton instance.

Returns:
the singleton instance

getParser

public <T> AbstractParser<T> getParser(Field field,
                                       Class<T> fieldConcreteClass)
                            throws AnnotationProcessorException
Return the parser to use on a field. If no parser annotation is setted on the field, try to identify a default parser from the concrete class.

Type Parameters:
T - the type the parser must return
Parameters:
field - the field
fieldConcreteClass - the concrete class from which instanciate the field values.
Returns:
the parser
Throws:
AnnotationProcessorException - if an error occurs during annotation reading or if no parser has been found.
See Also:
AbstractParser.identifyDefaultParser(Class)


Copyright © 2014. All rights reserved.