Search in sources :

Example 1 with StorIOContentResolverType

use of com.pushtorefresh.storio.contentresolver.annotations.StorIOContentResolverType in project storio by pushtorefresh.

the class StorIOContentResolverProcessor method processAnnotatedClass.

/**
     * Processes annotated class
     *
     * @param classElement type element annotated with {@link StorIOContentResolverType}
     * @param elementUtils utils for working with elementUtils
     * @return result of processing as {@link StorIOContentResolverTypeMeta}
     */
@NotNull
@Override
protected StorIOContentResolverTypeMeta processAnnotatedClass(@NotNull TypeElement classElement, @NotNull Elements elementUtils) {
    final StorIOContentResolverType storIOContentResolverType = classElement.getAnnotation(StorIOContentResolverType.class);
    final String commonUri = storIOContentResolverType.uri();
    final Map<String, String> urisForOperations = new HashMap<String, String>(3);
    urisForOperations.put("insert", storIOContentResolverType.insertUri());
    urisForOperations.put("update", storIOContentResolverType.updateUri());
    urisForOperations.put("delete", storIOContentResolverType.deleteUri());
    validateUris(classElement, commonUri, urisForOperations);
    final String simpleName = classElement.getSimpleName().toString();
    final String packageName = elementUtils.getPackageOf(classElement).getQualifiedName().toString();
    return new StorIOContentResolverTypeMeta(simpleName, packageName, storIOContentResolverType);
}
Also used : StorIOContentResolverTypeMeta(com.pushtorefresh.storio.contentresolver.annotations.processor.introspection.StorIOContentResolverTypeMeta) HashMap(java.util.HashMap) StorIOContentResolverType(com.pushtorefresh.storio.contentresolver.annotations.StorIOContentResolverType) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

StorIOContentResolverType (com.pushtorefresh.storio.contentresolver.annotations.StorIOContentResolverType)1 StorIOContentResolverTypeMeta (com.pushtorefresh.storio.contentresolver.annotations.processor.introspection.StorIOContentResolverTypeMeta)1 HashMap (java.util.HashMap)1 NotNull (org.jetbrains.annotations.NotNull)1