org.sormula.annotation
Class ImplicitTypeAnnotationReader

java.lang.Object
  extended by org.sormula.annotation.ImplicitTypeAnnotationReader

public class ImplicitTypeAnnotationReader
extends java.lang.Object

Reads ImplicitType annotations from classes. The first ImplicitType annotation found for a class is used. If ImplicitType is already defined for a class type, then it is ignored.

Since:
1.9.2 and 2.3.2
Author:
Jeff Miller

Constructor Summary
ImplicitTypeAnnotationReader(TypeTranslatorMap typeTranslatorMap, java.lang.reflect.Field field)
          Constructs for classes that may contain the annotation.
 
Method Summary
 void install()
          Reads ImplicitType annotations from sources and adds them to type map if they are not already defined.
protected  void updateMap(ImplicitType typeAnnotation)
          Adds a new instance of TypeTranslator to type translator map if not already defined for Field type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImplicitTypeAnnotationReader

public ImplicitTypeAnnotationReader(TypeTranslatorMap typeTranslatorMap,
                                    java.lang.reflect.Field field)
Constructs for classes that may contain the annotation.

Parameters:
typeTranslatorMap - a class that implements TypeTranslatorMap; typically Database and Table
field - field that contains ImplicitType annotation
Method Detail

install

public void install()
             throws java.lang.Exception
Reads ImplicitType annotations from sources and adds them to type map if they are not already defined.

Throws:
java.lang.Exception - if error creating TypeTranslator

updateMap

protected void updateMap(ImplicitType typeAnnotation)
                  throws java.lang.Exception
Adds a new instance of TypeTranslator to type translator map if not already defined for Field type.

Parameters:
typeAnnotation - definition of type to add
Throws:
java.lang.Exception - if error creating new instance of TypeTranslator