- Check that controls what packages can be imported in each - package. Useful for ensuring that application layering rules - are not violated, especially on large projects. + Controls what can be imported in each package. Useful for + ensuring that application layering rules are not violated, + especially on large projects.
- The following DTD is for a import control XML document. + The DTD for a import control XML document is at http://www.puppycrawl.com/dtds/import_control_1_0.dtd. It + contains documentation on each of the elements and attributes.
--<?xml version="1.0" encoding="UTF-8"?> - -<!ELEMENT import-control ((allow|disallow)*,subpackage*)> - -<!ATTLIST import-control - pkg NMTOKEN #REQUIRED> - -<!ELEMENT subpackage ((allow|disallow)*,subpackage*)> - -<!ATTLIST subpackage - name NMTOKEN #REQUIRED> - -<!ELEMENT allow EMPTY> - -<!ATTLIST allow - pkg NMTOKEN #REQUIRED> - -<!ELEMENT disallow EMPTY> - -<!ATTLIST disallow - pkg NMTOKEN #REQUIRED> --
The check validates a XML document when it loads the document. To validate against the above DTD, include the following @@ -391,9 +369,9 @@
- For an example import control file, look at the file called - "import-control.xml" which is part of the Checkstyle - distribution. + For an example import control file, look at the file called import-control.xml + which is part of the Checkstyle distribution.