@Override
 public void doTransform(
     final MutableClassDeclaration annotatedClass,
     @Extension final TransformationContext context) {
   Iterable<? extends AnnotationReference> _annotations = annotatedClass.getAnnotations();
   final Function1<AnnotationReference, Boolean> _function =
       new Function1<AnnotationReference, Boolean>() {
         @Override
         public Boolean apply(final AnnotationReference it) {
           AnnotationTypeDeclaration _annotationTypeDeclaration =
               it.getAnnotationTypeDeclaration();
           String _simpleName = _annotationTypeDeclaration.getSimpleName();
           String _simpleName_1 = Delegate.class.getSimpleName();
           return Boolean.valueOf(Objects.equal(_simpleName, _simpleName_1));
         }
       };
   Iterable<? extends AnnotationReference> _filter =
       IterableExtensions.filter(_annotations, _function);
   final AnnotationReference annotation = IterableExtensions.head(_filter);
   final String field = annotation.getStringValue("field");
   TypeReference _classValue = annotation.getClassValue("to");
   Type _type = _classValue.getType();
   final TypeDeclaration to = ((TypeDeclaration) _type);
   this.process(to, field, annotatedClass, context);
 }
Example #2
0
 public void getSuperClass(
     final List<MutableClassDeclaration> s,
     final MutableClassDeclaration c,
     @Extension final TransformationContext context) {
   TypeReference _extendedClass = c.getExtendedClass();
   boolean _notEquals = (!Objects.equal(_extendedClass, null));
   if (_notEquals) {
     TypeReference _extendedClass_1 = c.getExtendedClass();
     String _name = _extendedClass_1.getName();
     final MutableClassDeclaration l = context.findClass(_name);
     boolean _notEquals_1 = (!Objects.equal(l, null));
     if (_notEquals_1) {
       s.add(l);
       this.getSuperClass(s, l, context);
     }
   }
 }