org.tudalgo.algoutils.student.annotation.Forbidden Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of algoutils-student Show documentation
Show all versions of algoutils-student Show documentation
Common utilities for the Fachgebiet Algorithmik of TU Darmstadt
The newest version!
package org.tudalgo.algoutils.student.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation is used to mark methods from the standard library,
* that are forbidden to be used by the student in order to implement the annotated method.
*
* The following example shows how to use this annotation:
*
* {@code
* @Forbidden("java.lang.Math.max")
* public static int max(int a, int b) {
* if (a > b) {
* return a;
* } else {
* return b;
* }
* }
* }
* Alternatively the entire class or package can be forbidden:
*
* {@code
* @Forbidden("java.lang.Math")
* public static int max(int a, int b) {
* if (a > b) {
* return a;
* } else {
* return b;
* }
* }
* }
*/
@Documented
@Inherited
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.METHOD})
public @interface Forbidden {
/**
* The forbidden methods.
*
* @return the forbidden methods
*/
String[] value() default { };
}