https://github.com/vy/null-check
Validates @Nonnull method arguments at runtime using Spring AOP.
https://github.com/vy/null-check
Last synced: 6 months ago
JSON representation
Validates @Nonnull method arguments at runtime using Spring AOP.
- Host: GitHub
- URL: https://github.com/vy/null-check
- Owner: vy
- Created: 2015-01-30T12:05:21.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-30T12:05:32.000Z (over 11 years ago)
- Last Synced: 2024-10-17T03:36:06.541Z (over 1 year ago)
- Language: Java
- Size: 105 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This project implements a [Spring AOP](http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html)
driven runtime null check for `javax.annotation.Nonnull` annotated method parameters.
Internally, a `@Before` pointcut is used to intercept methods that have one or more `@Nonnull` annotated parameters
and check that their values are non-null. This functionality is provided by `nullCheck` AspectJ advice in
`com.vlkan.nullcheck.monitor.NullMonitor` class.
Dependencies
============
Using Spring Boot, you can easily setup your project by adding the following dependencies to your `pom.xml`:
org.springframework.boot
spring-boot-starter
org.springframework.boot
spring-boot-starter-aop
com.google.code.findbugs
jsr305
3.0.0
For those who do not want to use Spring Boot, they are free to add individual dependencies manually.
Usage
=====
Copy `com.vlkan.nullcheck.monitor.NullMonitor` to your project, under the directory where you keep your `@Aspect`s -- or
just simply go with `monitor` directory. Whenever you use a method parameter with `@Nonnull` annotation, it will be
intercepted by the aspect.
License
=======
The [null-check](https://github.com/vy/null-check/) by [Volkan Yazıcı](http://vlkan.com/) is licensed under the
[Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
[](http://creativecommons.org/licenses/by/4.0/)