All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.t1.annotations.MixinFor Maven / Gradle / Ivy

There is a newer version: 2.0.0.RC4
Show newest version
package com.github.t1.annotations;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * Add annotations to another class that you can't change; if you can change that class,
 * use explicit {@link Stereotype}s instead. Using Mixins is very implicit and difficult to trace back;
 * it is often better to actually copy the target class, so you can directly add your annotations,
 * instead of working with mixins. You have been warned!
 *
 * If you have a class that you don't control, e.g.:
 * 
 * 
 *     public class ImportedClass {
 *         ...
 *     }
 * 
* * And you need it to be annotated as @SomeAnnotation. Then you can write a mixin (the name is arbitrary): * *
 *     @MixinFor(ImportedClass.class)
 *     @SomeAnnotation
 *     public class ImportedClassMixin {
 *         ...
 *     }
 * 
* * After the Power Annotations have been resolved, the target class looks as if it had another annotation: * *
 *     @SomeAnnotation
 *     public class ImportedClass {
 *         ...
 *     }
 * 
*/ @Retention(RUNTIME) @Target(TYPE) public @interface MixinFor { Class value(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy