/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends ValueRelativeNumericalValueValidator { @Pure @Override public @Nonnull String getComparisonOperator() { return ">"; } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends FileValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# == null || !#.exists() || System.getProperty(\"os.name\").startsWith(\"Windows\") || #.canExecute()", "The # $ has to be executable.", element); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends ElementKindValidator { @Pure @Override public @Nonnull ElementKind getKind() { return ElementKind.ENUM; } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends ElementKindValidator { @Pure @Override public @Nonnull ElementKind getKind() { return ElementKind.INTERFACE; } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends FileValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# == null || System.getProperty(\"os.name\").startsWith(\"Windows\") || !#.isHidden()", "The # $ has to be visible.", element); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends FileValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# == null || !#.isAbsolute()", "The path of the # $ has to be relative.", element); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends NumericalValueValidator { @Pure @Override public @Nonnull String getComparisonOperator() { return ">="; } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends FileValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# == null || !#.exists() || !#.canWrite()", "The # $ may not be writable.", element); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends FileValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# == null || #.exists()", "The # $ has to exist.", element); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends NumericalValueValidator { @Pure @Override public @Nonnull String getComparisonOperator() { return "<="; } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends FileValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# == null || #.getAbsoluteFile().getParentFile().exists()", "The parent directory of the # has to exist.", element); } }
/** * A type annotation validator validates the annotations on the members of the annotated type. * * @see TypeValidator */ @Stateless public interface TypeAnnotationValidator extends AnnotationHandler {}
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends FileValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# == null || System.getProperty(\"os.name\").startsWith(\"Windows\") || #.isHidden()", "The # $ has to be hidden.", element); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator implements ValueAnnotationValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with((ProcessingUtility.getType(element).getKind().isPrimitive() ? "" : "# == null || ") + "String.valueOf(#).equals(\"@\")", "The # has to equal '@' but was $.", element, annotationMirror); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends IndexValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# >= 0 && # <= size()", "The # may not be negative or greater than the size of this collection but was $.", element); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator implements ValueAnnotationValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# == this", "The # has to be <this> but was $.", element); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends ElementKindValidator { @Pure @Override public @Nonnull ElementKind getKind() { return ElementKind.CLASS; } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends FileValidator { @Pure @Override public @Nonnull Contract generateContract(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull TypeImporter typeImporter) { return Contract.with("# == null || !#.exists() || #.canWrite()", "The # $ has to be writable.", element); } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends ValueRelativeNumericalValueValidator { @Pure @Override public @Nonnull String getComparisonOperator() { return "<"; } }
/** * This class checks the use of and generates the contract for the surrounding annotation. */ @Stateless public static class Validator extends NestingKindValidator { @Pure @Override public @Nonnull NestingKind getKind() { return NestingKind.ANONYMOUS; } }