![JAR search and dependency download from the Maven repository](/logo.png)
org.loom.appengine.converter.RootKeyConverterFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of loom-appengine Show documentation
Show all versions of loom-appengine Show documentation
Uploads all artifacts belonging to configuration ':archives'.
The newest version!
package org.loom.appengine.converter;
import javax.inject.Singleton;
import org.loom.appengine.annotations.RootKey;
import org.loom.appengine.annotations.RootKey.RootKeyType;
import org.loom.binding.AnnotationContainer;
import org.loom.converter.AnnotationDrivenConverterFactory;
import org.simpleds.converter.Converter;
import com.google.appengine.api.datastore.Key;
/**
* Create {@link Converter} for {@link Key} properties
* @author Nacho
*
*/
@Singleton
public class RootKeyConverterFactory implements AnnotationDrivenConverterFactory {
public org.loom.converter.Converter getConverter(AnnotationContainer propertyWrapper, RootKey annotation) {
if (propertyWrapper.getPropertyClass() != Key.class) {
return null;
}
Class> persistentClass = annotation.value();
return annotation.type() == RootKeyType.NAME? new KeyNameConverter(persistentClass) : new KeyIdConverter(persistentClass);
}
public Class getAnnotationClass() {
return RootKey.class;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy