private void createDeclaredViews(
      final Map<String, DesignDocument.View> views, final Class<?> klass) {
    eachAnnotation(
        klass,
        Views.class,
        new Predicate<Views>() {

          public boolean apply(Views input) {
            for (View v : input.value()) {
              addView(views, v, klass);
            }
            return true;
          }
        });

    ReflectionUtils.eachAnnotation(
        klass,
        View.class,
        new Predicate<View>() {

          public boolean apply(View input) {
            addView(views, input, klass);
            return true;
          }
        });
  }
 private void expandSupertypes(Multimap<String, String> mmap, String key, Class<?> type) {
   for (Class<?> supertype : ReflectionUtils.getSuperTypes(type)) {
     if (mmap.put(supertype.getName(), key)) {
       if (log != null) log.debug("expanded subtype {} -> {}", supertype.getName(), key);
       expandSupertypes(mmap, supertype.getName(), supertype);
     }
   }
 }
 private String resolveTypeDiscriminatorForBackReference(Member m) {
   Method me =
       ReflectionUtils.findMethod(
           m.getDeclaringClass(), "get" + firstCharToUpperCase(m.getName()));
   if (me != null) {
     return resolveTypeDiscriminator(resolveReturnType(me));
   }
   return "";
 }
Beispiel #4
0
 /**
  * gets all sub types in hierarchy of a given type
  *
  * <p>depends on SubTypesScanner configured
  */
 public <T> Set<Class<? extends T>> getSubTypesOf(final Class<T> type) {
   return Sets.newHashSet(
       ReflectionUtils.<T>forNames(
           store.getAll(index(SubTypesScanner.class), Arrays.asList(type.getName())), loaders()));
 }