문제

Im passing a proxy object in to a method which expects a specific argument type, the proxy object isn't an instance of the expected type however it does through it's noSuchMethod support all the functionality of the expected concrete type, I want to keep the argument type specification for static type checking whilst I'm coding, I would also like to keep the type checking on whilst I'm debugging my code, but I thought it wouldn't throw type exceptions when the class that causes the error is a proxy object? is there anyway to do this with all the type checking on?

도움이 되었습니까?

해결책

You could implement the argument type.

@proxy
class MyProxy implements MyArgumentType {
  ...
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top