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