All Classes and Interfaces
Class
Description
Default base implementation of
ClassesTransformer, where only AbstractClassesTransformer.doTransform(JavaClasses)
has to be implemented, while description and filtering via AbstractClassesTransformer.that(DescribedPredicate) are provided.Represents the target of a
JavaAccess.Represents an
AccessTarget where the target is a code unit.Predefined
functions to transform AccessTarget.CodeUnitAccessTarget.Represents an
AccessTarget where the target is a code unit.Represents an
AccessTarget where the target is a code unit.Represents a
AccessTarget.CodeUnitCallTarget where the target is a constructor.Predefined
functions to transform AccessTarget.ConstructorCallTarget.Represents a
AccessTarget.CodeUnitReferenceTarget where the target is a constructor.Predefined
functions to transform AccessTarget.ConstructorReferenceTarget.Represents an
AccessTarget where the target is a field.Predefined
functions to transform AccessTarget.FieldAccessTarget.Predefined
functions to transform AccessTarget.Represents a
AccessTarget.CodeUnitCallTarget where the target is a method.Predefined
functions to transform AccessTarget.MethodCallTarget.Represents a
AccessTarget.CodeUnitReferenceTarget where the target is a method.Predefined
functions to transform AccessTarget.MethodReferenceTarget.Predefined
predicates targeting AccessTarget.Defines which module may depend on which other modules by
Start the definition by following the fluent API through
Extend the definition by calling
module name.Start the definition by following the fluent API through
AllowedModuleDependencies.allow().Extend the definition by calling
AllowedModuleDependencies.fromModule(String) multiple times.An
ArchModule.Descriptor that carries along a specific Annotation.An
ArchCondition that derives which objects satisfy/violate the condition from a DescribedPredicate.Defines how to describe a single
ConditionEvent.A collection of predefined
ArchConditions that can be customized or joined together
via ArchCondition.and(ArchCondition) and ArchCondition.or(ArchCondition).Allows access to configured properties in "archunit.properties".
Offers convenience to assert typical architectures:
Architectures.layeredArchitecture()
Architectures.onionArchitecture()
Defines which dependencies the layered architecture will consider when checking for violations.
Represents a generic "architecture module", i.e.
Contains meta-information for an
ArchModule.An
ArchModule.Identifier of an ArchModule.A collection of
"architectural modules".An element of the fluent API to create
ArchModulesAn element of the fluent API to create
ArchModulesAn element of the fluent API to create
ArchModulesA generic interface to be extended by users for providing custom implementations of
ArchModule.Descriptor
that can carry along more meta-information from the modularized JavaClasses.Defines which
classes belong to the same ArchModule.Identifier and thus will eventually
end up in the same ArchModule.A more convenient
ArchModules.DescriptorCreator tailored to the case that we
define our modules by root classes.Predefined
predicates that offer syntactic sugar.Represents a rule about a specified set of objects of interest (e.g.
ArchUnit extensions need to implement this interface.
Predefined
predicates targeting objects that implement CanBeAnnotatedAllows to join together any existing
ArchCondition of this rule with another ArchCondition
via and or or.The central API to import
JavaClasses from compiled Java class files.The
For example, if you import the package
ClassFileImporter will use the configured ClassResolver, to determine how to
resolve further dependencies.For example, if you import the package
com.foo.bar, and some class com.foo.bar.FooBar
calls a method of com.other.Dependency, the ClassResolver will decide how this dependency should
be treated, i.e.Provides a way to import a JavaClass from a given
URI.A
ClassResolver that tries to locate missing dependencies on the classpath.Calculates architecture metrics as defined by Robert C.
An event that occurred while checking an
ArchCondition.Handles the data of a
As an example, this could be a single element of type
ConditionEvent that is the corresponding objects and the description
(compare ConditionEvent.handleWith(Handler)).As an example, this could be a single element of type
JavaMethodCall together with a description, likeCollects
events that occur when checking ArchConditions.A cycle formed by the referenced
EDGEs.A generic
Construct it by following the fluent interface of
ArchCondition to check arbitrary COMPONENTs consisting of JavaClasses
for cyclic dependencies between those components (induced by the dependencies of the contained classes).Construct it by following the fluent interface of
CycleArchCondition.builder().Represents a dependency of one Java class on another Java class.
Predefined
functions to transform Dependency.Predefined
predicates targeting Dependency.DependencyRules provides a set of general
ArchConditions
and ArchRules for checking dependencies between classes.A predicate holding a description.
Serves the same purpose as
ArchModules.DescriptorCreator, but carries along a description
to be used by rule syntax elements.DomainBuilders.AccessTargetBuilder<MEMBER extends JavaMember,TARGET extends AccessTarget,SELF extends DomainBuilders.AccessTargetBuilder<MEMBER,TARGET,SELF>>
DomainBuilders.CodeUnitAccessTargetBuilder<CODE_UNIT extends JavaCodeUnit,ACCESS_TARGET extends AccessTarget.CodeUnitAccessTarget>
DomainBuilders.JavaAccessBuilder<TARGET extends AccessTarget,SELF extends DomainBuilders.JavaAccessBuilder<TARGET,SELF>>
DomainBuilders.JavaCodeUnitBuilder<OUTPUT,SELF extends DomainBuilders.JavaCodeUnitBuilder<OUTPUT,SELF>>
Together with
DomainBuilders, this class is the link to create domain objects from the import
context.Bundles an
ArchRule together with the JavaClasses that were evaluated, and the
respective EvaluationResult.Represents the result of evaluating an
ArchRule against some JavaClasses.Allows to customize violation messages and rule text of
ArchRules.A decorator around an existing
ArchRule that "freezes" the state of all violations on the first call instead of failing the test.GeneralCodingRules provides a set of very general
ArchConditions
and ArchRules for coding that might be useful in various projects.Allows to further filter the set of all objects via
GivenConjunction.and(DescribedPredicate) or GivenConjunction.or(DescribedPredicate)
or create a complete ArchRule via GivenConjunction.should(ArchCondition).Predefined
predicates targeting objects that implement HasModifiersPredefined
predicates targeting objects that implement HasName.AndFullNamePredefined
predicates targeting objects that implement HasNameA highly context dependent definition of something that has a higher order "owner".
Predefined
predicates targeting objects that implement HasOwnerPredefined
predicates targeting objects that implement HasParameterTypesPredefined
functions to transform HasReturnType.Predefined
predicates targeting objects that implement HasReturnTypeHasThrowsClause<LOCATION extends HasParameterTypes & HasReturnType & HasName.AndFullName & CanBeAnnotated & HasOwner<JavaClass>>
Predefined
predicates targeting objects that implement HasThrowsClausePredefined
predicates targeting objects that implement HasTypeWill be evaluated for every class location, to determine if the class should be imported.
IMPORTANT: For things like caching to work, it's important that the behavior of any implementation is constant, i.e.
IMPORTANT: For things like caching to work, it's important that the behavior of any implementation is constant, i.e.
Best effort
NOTE: This excludes all class files residing in some directory ../build/classes/../testFixtures/..
ImportOption to omit checking test fixtures defined by the
Gradle Test Fixtures Plugin.NOTE: This excludes all class files residing in some directory ../build/classes/../testFixtures/..
Excludes
package-info.class files.Best effort
NOTE: This excludes all class files residing in some directory ../target/test-classes/.., ../build/classes/test/..
ImportOption to check rules only on main classes.NOTE: This excludes all class files residing in some directory ../target/test-classes/.., ../build/classes/test/..
Best effort
See
ImportOption to check rules only on test classes.See
ImportOption.DoNotIncludeTests for limitations of test class identification.Any element annotated with this annotation, is meant for internal use ONLY.
Resolved via
PluginLoaderPredefined
functions to transform JavaAccess.Predefined
predicates targeting JavaAccess.Represents an imported annotation on an annotated object like a class or a method.
Default implementation of
JavaAnnotation.ParameterVisitor implementing a no-op
behavior, i.e.A Visitor (compare
The list of declared methods is exhaustive, thus any legal parameter type of an
JavaAnnotation.accept(ParameterVisitor)) offering possibilities to specify
behavior when various types of JavaAnnotation.getProperties() are encountered.The list of declared methods is exhaustive, thus any legal parameter type of an
Annotation
is represented by the respective visit-method.Predefined
predicates targeting JavaCall.Predefined
predicates targeting JavaClass.Represents a unit of code containing accesses to other units of code.
Predefined
functions to transform JavaCodeUnit.Predefined
predicates targeting JavaCodeUnit.Predefined
predicates targeting JavaCodeUnitAccess.Predefined
predicates targeting JavaCodeUnitReference.Predefined
predicates targeting JavaFieldAccess.Represents a generic array type used in signatures of parameterized types.
E.g.
E.g.
Predefined
predicates targeting JavaMember.Represents a package of Java classes as defined by the
Java Language Specification.
Predefined
functions to transform JavaPackage.A parameter of a
JavaCodeUnit, i.e.A
JavaParameterizedType represents a concrete parameterization of a generic type.Represents the static initialization block of a class, e.g.
Represents a general Java type.
Represents a type variable used by generic types and members.
E.g.
E.g.
Represents a wildcard type in a type signature (compare the JLS).
Calculates architecture metrics as defined by John Lakos in his book "Large-Scale C++ Software Design".
To calculate these metrics every component is assigned a "dependsOn" value that represents the number of other components that this component can reach transitively, including itself.
To calculate these metrics every component is assigned a "dependsOn" value that represents the number of other components that this component can reach transitively, including itself.
Handles various forms of location from where classes can be imported in a consistent way.
Represents a set of
locations of Java class files.Marks the methods or classes, where resolving types via reflection is allowed.
Same as
ClassesShouldConjunction but for rules about members.Represents a component of the software system.
A collection of
MetricsComponent.A dependency between two
ArchModules.Used to specify which dependencies should be checked by the respective
ArchRule.Matches packages with a syntax similar to AspectJ.
Allows to evaluate PlantUML Component Diagrams
as ArchUnit rules.
Used to specify which dependencies should be checked by the condition.
ProxyRules provides a set of general
ArchConditions
and ArchRules for checking the usage of proxies.Marks classes and members that are part of ArchUnit's public API.
Predefined
functions to transform ReferencedClassObject.Marks the methods or classes that resolve types via reflection so we can use it for architecture
assertions.
Only resolves classes from classpath that are beneath the configured
SelectedClassResolverFromClasspath.packageRoots.A collection of
JavaClasses modelling some domain aspect of a code basis.A mapping
JavaClass -> SliceIdentifier which defines how to partition
a set of JavaClasses into Slices.A unique identifier of a
Slice.Basic collection of
Slice for tests of dependencies between different domain packages, e.g.Allows to specify
ArchRules for "slices" of a code base.Contains information about an imported class, i.e.
Location in the source code of an ArchUnit domain object.
A text file based implementation of a
This
It will keep an index of all stored rules as well as a mapping to the individual rule violation files in the same folder.
By default, the layout within the configured store folder will look like:
ViolationStore.This
ViolationStore will store the violations of every single FreezingArchRule in a dedicated file.It will keep an index of all stored rules as well as a mapping to the individual rule violation files in the same folder.
By default, the layout within the configured store folder will look like:
Allows to adjust the rule violation file names of
TextFileBasedViolationStoreThrowsClause<LOCATION extends HasParameterTypes & HasReturnType & HasName.AndFullName & CanBeAnnotated & HasOwner<JavaClass>>
Predefined
functions to transform ThrowsClause.ThrowsDeclaration<LOCATION extends HasParameterTypes & HasReturnType & HasName.AndFullName & CanBeAnnotated & HasOwner<JavaClass>>
Represents one declared exception of a
ThrowsClause.Predefined
functions to transform ThrowsDeclaration.Allows
FreezingArchRule to decide when two lines of two violations count as "equivalent".Provides some sort of storage for violations to
FreezingArchRule.A simple delegate for a
ViolationStore to allow adjusting the behavior of another
ViolationStore by delegation (e.g.Calculates visibility metrics as defined by Herbert Dowalil in his book
"Modulare Softwarearchitektur: Nachhaltiger Entwurf durch Microservices, Modulithen und SOA 2.0".