1 21 package com.db4o.config.annotations.reflect; 22 23 import java.lang.annotation.Annotation ; 24 import java.lang.reflect.AnnotatedElement ; 25 26 import com.db4o.config.annotations.GeneratedVersionNumbers; 27 28 31 public class GeneratedVersionNumbersFactory implements Db4oConfiguratorFactory { 32 33 public Db4oConfigurator configuratorFor(AnnotatedElement element, 34 Annotation annotation) { 35 if (!annotation.annotationType().equals(GeneratedVersionNumbers.class)) { 36 return null; 37 } 38 String className=null; 39 40 if(element instanceof Class ) { 41 className=((Class )element).getName(); 42 } 43 44 boolean value= ((GeneratedVersionNumbers) annotation).value(); 45 return new GeneratedVersionNumbersConfigurator(className, value); 46 } 47 48 } 49 | Popular Tags |