io.vertx.codegen.annotations.ProxyGen Java Examples

The following examples show how to use io.vertx.codegen.annotations.ProxyGen. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ServiceProxyExtension.java    From weld-vertx with Apache License 2.0 5 votes vote down vote up
void findServiceInterfaces(@Observes @WithAnnotations(ProxyGen.class) ProcessAnnotatedType<?> event, BeanManager beanManager) {
    AnnotatedType<?> annotatedType = event.getAnnotatedType();
    if (annotatedType.isAnnotationPresent(ProxyGen.class) && annotatedType.getJavaClass().isInterface()) {
        LOGGER.debug("Service interface {0} discovered", annotatedType.getJavaClass());
        serviceInterfaces.add(annotatedType.getJavaClass());
    }
}
 
Example #2
Source File: ServiceRegistry.java    From nubes with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static <T> Class<T> getInterface(Class<?> serviceClass) {
  if (serviceClass.isAnnotationPresent(ProxyGen.class)) {
    return (Class<T>) serviceClass;
  }
  Class<?>[] interfaces = serviceClass.getInterfaces();
  for (Class<?> someInterface : interfaces) {
    if (someInterface.isAnnotationPresent(ProxyGen.class)) { // it must be it
      return (Class<T>) someInterface;
    }
  }
  return null;
}
 
Example #3
Source File: GeneratorHelper.java    From vertx-codegen with Apache License 2.0 5 votes vote down vote up
private MyProcessor(Function<CodeGen, R> f, Set<String> otherSupportedAnnotations) {
  this.f = f;
  this.supportedAnnotations = new HashSet<>();
  this.supportedAnnotations.add(ProxyGen.class.getCanonicalName());
  this.supportedAnnotations.add(VertxGen.class.getCanonicalName());
  this.supportedAnnotations.add(DataObject.class.getCanonicalName());
  this.supportedAnnotations.add(ModuleGen.class.getCanonicalName());
  this.supportedAnnotations.addAll(otherSupportedAnnotations);
}
 
Example #4
Source File: ProxyModelProvider.java    From vertx-service-proxy with Apache License 2.0 5 votes vote down vote up
@Override
public Model getModel(ProcessingEnvironment env, TypeMirrorFactory typeFactory, TypeElement elt) {
  if (elt.getAnnotation(ProxyGen.class) != null) {
    ProxyModel model = new ProxyModel(env, typeFactory, elt);
    return model;
  } else {
    return null;
  }
}
 
Example #5
Source File: ServiceProxyHandlerGen.java    From vertx-service-proxy with Apache License 2.0 4 votes vote down vote up
@Override
public Collection<Class<? extends Annotation>> annotations() {
  return Arrays.asList(ProxyGen.class, ModuleGen.class);
}
 
Example #6
Source File: ServiceProxyGen.java    From vertx-service-proxy with Apache License 2.0 4 votes vote down vote up
@Override
public Collection<Class<? extends Annotation>> annotations() {
  return Arrays.asList(ProxyGen.class, ModuleGen.class);
}