1 20 21 package spoon.aval.support.validator; 22 23 import spoon.aval.Validator; 24 import spoon.aval.annotation.structure.AValTarget; 25 import spoon.aval.processing.AValProcessor; 26 import spoon.aval.processing.ValidationPoint; 27 28 39 public class AValTargetValidator implements Validator<AValTarget> { 40 41 45 public void check(ValidationPoint<AValTarget> vp) { 46 if (!vp.getValAnnotation().value().isAssignableFrom( 47 vp.getProgramElement().getClass())) { 48 String message = vp.getValAnnotation().message().replace("?val", vp.getValAnnotation().value().toString()); 49 ValidationPoint.report(vp.getValAnnotation().severity(), vp.getDslAnnotation(), 50 message,vp.fixerFactory(vp.getValAnnotation().fixers())); 51 } 52 } 53 54 } 55 | Popular Tags |