public interface ArchUnitExtension
com.mycompany.MyArchUnitExtension
ServiceLoader
.Modifier and Type | Method and Description |
---|---|
void |
configure(java.util.Properties properties)
Before calling
handle(EvaluatedRule) , ArchUnit will call this method, to pass configured
properties to the extension. |
java.lang.String |
getUniqueIdentifier()
An unique String, identifying this extension, so ArchUnit can associate configured properties.
|
void |
handle(EvaluatedRule evaluatedRule)
ArchUnit will call this method after evaluating any rule against imported classes, but before any
AssertionError is thrown from possible violations of the rule. |
java.lang.String getUniqueIdentifier()
void configure(java.util.Properties properties)
handle(EvaluatedRule)
, ArchUnit will call this method, to pass configured
properties to the extension. Properties for an extension
can be configured via "/archunit.properties"
(compare ArchConfiguration
).
Extension properties are identified by prefixing each property to pass with
extension.${extension-id}
(where ${extension-id}
refers to the unique id of this extension configured via
getUniqueIdentifier()
). This way, configuration follows an uniform way.
extension.my-extension.foo=bar
extension.my-extension.baz=quux
will pass a Properties
object to the extension with getUniqueIdentifier()
== "my-extension",
which contains the entries
foo=bar
baz=quux
properties
- Object holding the configured properties of this extensionvoid handle(EvaluatedRule evaluatedRule)
AssertionError
is thrown from possible violations of the rule.evaluatedRule
- Contains details about the evaluated rule, i.e. which rule was evaluated, the imported
classes and the result of the evaluation