Class MethodValidator


  • public final class MethodValidator
    extends Object
    Validates method calls.

    We do this manual processing of javax.validation.constraints.* annotations only because JSR-303 in its current version doesn't support method level validation (see its Appendix C). At the moment we don't support anything expect these two annotations. We think that it's better to wait for JSR-303.

    The class is thread-safe.

    Since:
    0.1.10
    See Also:
    Appendix C, How it works
    • Constructor Detail

      • MethodValidator

        public MethodValidator()
    • Method Detail

      • beforeMethod

        public void beforeMethod​(org.aspectj.lang.JoinPoint point)
        Validate arguments of a method.

        Try NOT to change the signature of this method, in order to keep it backward compatible.

        Parameters:
        point - Join point
      • beforeCtor

        public void beforeCtor​(org.aspectj.lang.JoinPoint point)
        Validate arguments of constructor.

        Try NOT to change the signature of this method, in order to keep it backward compatible.

        Parameters:
        point - Join point
      • after

        public void after​(org.aspectj.lang.JoinPoint point,
                          Object result)
        Validate method response.

        Try NOT to change the signature of this method, in order to keep it backward compatible.

        Parameters:
        point - Join point
        result - Result of the method
        Since:
        0.7.11