public class ExplicitTypeAnnotationReader
extends java.lang.Object
ExplicitType
annotations from classes. The first ExplicitType
annotation found for a class is used. If ExplicitType is already defined for
a class type, then it is ignored.Constructor and Description |
---|
ExplicitTypeAnnotationReader(TypeTranslatorMap typeTranslatorMap,
java.lang.Class<?>... sources)
Constructs for classes that may contain the annotation.
|
Modifier and Type | Method and Description |
---|---|
void |
install()
Reads
ExplicitType annotations from sources and adds them to
type map if they are not already defined. |
protected void |
updateMap(ExplicitType typeAnnotation)
Adds a new instance of
TypeTranslator to type translator map if not already
defined for ExplicitType.type() . |
public ExplicitTypeAnnotationReader(TypeTranslatorMap typeTranslatorMap, java.lang.Class<?>... sources)
typeTranslatorMap
- a class that implements TypeTranslatorMap
; typically
Database
and Table
sources
- classes that contain ExplicitType
or ExplicitTypes
annotationspublic void install() throws java.lang.Exception
ExplicitType
annotations from sources and adds them to
type map if they are not already defined.java.lang.Exception
- if error creating TypeTranslator
protected void updateMap(ExplicitType typeAnnotation) throws java.lang.Exception
TypeTranslator
to type translator map if not already
defined for ExplicitType.type()
.
Versions prior to 1.9.2 did not allow type translators to be replaced. Starting with
version 1.9.2 and 2.3.2, this method will replace existing type translator with new
one ExplicitType.translator()
is different from existing.
typeAnnotation
- definition of type to addjava.lang.Exception
- if error creating new instance of TypeTranslator