diff --git a/import-control.xml b/import-control.xml index db12c3902..385dba5e6 100755 --- a/import-control.xml +++ b/import-control.xml @@ -16,19 +16,19 @@ - - - - + + + + + local-only="true"/> + local-only="true"/> diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/imports/import_control_1_0.dtd b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/imports/import_control_1_0.dtd index 102957db8..94a2a90f1 100755 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/imports/import_control_1_0.dtd +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/imports/import_control_1_0.dtd @@ -1,25 +1,72 @@ - + + + + + + pkg NMTOKEN #REQUIRED> + + + + local-only (true) #IMPLIED"> + + diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_complete.xml b/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_complete.xml index effe13c4e..3bdfcad3e 100755 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_complete.xml +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_complete.xml @@ -5,10 +5,10 @@ - + - - + + diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_one.xml b/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_one.xml index ec5011063..c3f322364 100755 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_one.xml +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_one.xml @@ -6,7 +6,7 @@ - + diff --git a/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_two.xml b/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_two.xml index 1ae5264d8..a8293c7ec 100755 --- a/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_two.xml +++ b/src/testinputs/com/puppycrawl/tools/checkstyle/import-control_two.xml @@ -5,10 +5,10 @@ - + - - - + + + diff --git a/src/xdocs/config_imports.xml b/src/xdocs/config_imports.xml index a10f5749a..a2dca4b62 100755 --- a/src/xdocs/config_imports.xml +++ b/src/xdocs/config_imports.xml @@ -313,39 +313,17 @@

- 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.