Esempio n. 1
0
  public ImmutableTypesWrapper(AnnotationWrapper mapper, MapperGeneratorContext context) {
    this.mapper = mapper;
    this.context = context;
    this.immutables = new HashMap<InOutType, MappingBuilder>();
    this.unusedImmutables = new HashSet<InOutType>();

    List<String> immutables = mapper.getAsStrings("withImmutables");
    for (String immutableClass : immutables) {
      final TypeElement element =
          context.elements.getTypeElement(immutableClass.replace(".class", ""));

      InOutType ioType = new InOutType(element.asType(), element.asType(), false);
      this.immutables.put(ioType, MappingBuilder.newImmutable());
      this.immutables.put(new InOutType(ioType, true), MappingBuilder.newImmutable());
      this.unusedImmutables.add(ioType);
    }
  }
 public String description() {
   return (String) header.getProperty("description");
 }
 public String name() {
   return (String) header.getProperty("name");
 }
Esempio n. 4
0
 public void reportUnused() {
   for (InOutType immutableIO : unusedImmutables) {
     context.warn(
         mapper.getAnnotatedElement(), "Immutable class \"%s\" is never used", immutableIO.in());
   }
 }