Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 1.04 KB

PACKAGE_SCANNER.md

File metadata and controls

19 lines (10 loc) · 1.04 KB

Package scanner

The package scanner in the TBot Framework is very simple and have several rules, which can help you understand right usage of handlers, rules and classes.

First rule

Firstly, the main class, which you give to the framework will be used to scan all other classes in the same or nested packages. For example, for given class org.examle.package.Main.class the all other classes will be find in org.example.package.*, but not org.example.*. It may be a issue, if you give package inner class instead of required level.

Second rule

Secondly, the classes which contains handlers or rule handlers, must be have applicable constructor. It means that the package scanner will fall into an exception if the class have constructor with unknown arguments.

Third rule

Thirdly, the classes which doesn't contains handlers will be skipped.

Conclusion

That's all. Also I have to tell about definition 'handler' in package scanner's sense: "The handlers is a class method (non-static) which is marked by the @Rule annotation."