Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Latest commit

 

History

History
26 lines (20 loc) · 795 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 795 Bytes

mixins4j

Enhancing java with mixins. You can write code such as:

@Mixin(superclass = Animal.class, delegates = {Duck.class, Dog.class})
public class Mutant extends AnimalMixin {

  public static void main(String[] args) {
    Mutant mutant = new Mutant();
    mutant.bark();
    mutant.quack();
    mutant.run();
  }
}

Class Mutant will inherit all inheritable methods from Animal, Duck and Dog. Class AnimalMixin will be generated by java processor and will extend class Animal.

Inspired by javadude annotations

Installation

Import project to eclipse and export as jar. Import jar into mixins4jtests and set up as java preprocessor.