inspector icon indicating copy to clipboard operation
inspector copied to clipboard

Missing default support for GenerateValidator notation?

Open leobert-lan opened this issue 6 years ago • 1 comments

In the service provider interface: io.sweers.inspector.compiler.plugins.spi.InspectorExtension, the default implement for Set<String> applicableAnnotations() return a empty set, as effect, nothing will be generated for a simple pojo class with GenerateValidator notation. Maybe it should be as follows better.

  default Set<String> applicableAnnotations() {
      return Collections.singleton("io.sweers.inspector.compiler.annotations.GenerateValidator");
//    return Collections.emptySet();
  }

or just add the GenerateValidator's class path into the result of io.sweers.inspector.compiler.InspectorProcessor#getSupportedAnnotationTypes

leobert-lan avatar Nov 14 '18 06:11 leobert-lan

umm...I forgot the Factory in GenerateValidator. maybe it's better to use dynamic generated instances of validator to validate simple pojo class's instance. it can minimize the size of the apk, is't it?

By the way, it's awesome to add a custom implement of InspectorExtension in the application to guide apt generating validator class.😊

leobert-lan avatar Nov 14 '18 07:11 leobert-lan