use of com.pushtorefresh.storio.sqlite.annotations.StorIOSQLiteType in project storio by pushtorefresh.
the class StorIOSQLiteProcessor method processAnnotatedClass.
/**
* Processes annotated class.
*
* @param classElement type element annotated with {@link StorIOSQLiteType}
* @param elementUtils utils for working with elementUtils
* @return result of processing as {@link StorIOSQLiteTypeMeta}
*/
@NotNull
@Override
protected StorIOSQLiteTypeMeta processAnnotatedClass(@NotNull TypeElement classElement, @NotNull Elements elementUtils) {
final StorIOSQLiteType storIOSQLiteType = classElement.getAnnotation(StorIOSQLiteType.class);
final String tableName = storIOSQLiteType.table();
if (tableName.length() == 0) {
throw new ProcessingException(classElement, "Table name of " + classElement.getSimpleName() + " annotated with " + StorIOSQLiteType.class.getSimpleName() + " is empty");
}
final String simpleName = classElement.getSimpleName().toString();
final String packageName = elementUtils.getPackageOf(classElement).getQualifiedName().toString();
return new StorIOSQLiteTypeMeta(simpleName, packageName, storIOSQLiteType, classElement.getModifiers().contains(Modifier.ABSTRACT));
}
Aggregations