# Access Rules

Access rules can be added to build classpath entries to specify which types in the given entry can be accessed and which not. If the compiler detects a type access to a type that should not be accessed, it will create a problem marker.

- Non-accessible rules define types that must not be referenced. The compiler typically creates an error marker for accesses to these types.
- Discouraged rules define types that should not be referenced. The compiler typically creates a warning marker for accesses to these types.
- Accessible rules define types that can be referenced.

Each rule consist of a pattern (same format as ANT patterns) and one of the rule types listed above.
Each classpath entry can have any number of rules defined. The compiler will process the list in the order defined and take the first matching rule.
The severity of the problem marker generated for accesses to 'Non-accessible' and 'Discouraged' type can be configured on the Java compiler's Error/Warnings preference page.

Combine Access Rules
Java builder
Classpath variable
Inclusion and exclusion patterns

Java build path properties
Error/Warnings preference page