A java processor that force constructors to be declared as you want.
Let's say you want to have all sub classes of NoArgsClass to declare a constructor without arguments, then just add @CheckArgs to your class declaration just as shown below.
@CheckArgs
public abstract class NoArgsClass {
public NoArgsClass() {
}
}
If you want all sub classes of StringArgClass to declare a constructor with String class arguments :
@CheckArgs( types = {String.class})
public abstract class StringArgClass {
public StringArgClass(String s) {
}
}
or with more arguments
@CheckArgs( types = {String.class, long.class, String.class})
public abstract class MultipleArgClass {
public StringArgClass(String s1, lonf l, String s2) {
}
}
<repositories>
<repository>
<id>hexosse-repo</id>
<url>https://raw.github.com/hexosse/maven-repo/master/</url>
</repository>
</repositories>
<dependencies>
<!-- Dependency to CheckArgs annotation -->
<dependency>
<groupId>com.github.hexocraftapi.checkargs</groupId>
<artifactId>annotation</artifactId>
<version>1.0.0</version>
</dependency>
<!-- Dependency to CheckArgs processor -->
<dependency>
<groupId>com.github.hexocraftapi.checkargs</groupId>
<artifactId>processor</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>