Package org.archifacts.core.descriptor
Interface BuildingBlockDescriptor
-
- All Superinterfaces:
Descriptor
public interface BuildingBlockDescriptor extends Descriptor
Describes aBuildingBlock.- Author:
- Oliver Libutzki
- See Also:
BuildingBlock
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static BuildingBlockDescriptorforAnnotatedWith(BuildingBlockType buildingBlockType, Class<? extends Annotation> type)Convenient method to create a new descriptor matching alljava classesthat are annotated with the given annotation.static BuildingBlockDescriptorforAssignableTo(BuildingBlockType buildingBlockType, Class<?>... types)Convenient method to create a new descriptor matching alljava classesthat are assignable to at least one of the given types.static BuildingBlockDescriptorforMetaAnnotatedWith(BuildingBlockType buildingBlockType, Class<? extends Annotation> type)Convenient method to create a new descriptor matching alljava classesthat are meta-annotated with the given annotation.static BuildingBlockDescriptorforSimpleNameEndingWith(BuildingBlockType buildingBlockType, String suffix)Convenient method to create a new descriptor matching alljava classeswhose simple name ends with a given suffix.booleanisBuildingBlock(com.tngtech.archunit.core.domain.JavaClass javaClass)BuildingBlockTypetype()The type of theBuildingBlockwhich this descriptor describes.
-
-
-
Method Detail
-
type
BuildingBlockType type()
The type of theBuildingBlockwhich this descriptor describes.- Returns:
- the type of the
BuildingBlockwhich this descriptor describes. Cannot be null.
-
isBuildingBlock
boolean isBuildingBlock(com.tngtech.archunit.core.domain.JavaClass javaClass)
- Parameters:
javaClass- TheJavaClassto be evaluated- Returns:
- true, if the given
JavaClassis aBuildingBlockof typetype(), otherwise false.
-
forSimpleNameEndingWith
static BuildingBlockDescriptor forSimpleNameEndingWith(BuildingBlockType buildingBlockType, String suffix)
Convenient method to create a new descriptor matching alljava classeswhose simple name ends with a given suffix. The suffix matching is case sensitive.- Parameters:
buildingBlockType- The type of theBuildingBlockthe new descriptor should describe. Must not benull.suffix- The suffix the matching java classes should end with. Must not benull.- Returns:
- A new descriptor.
-
forAssignableTo
static BuildingBlockDescriptor forAssignableTo(BuildingBlockType buildingBlockType, Class<?>... types)
Convenient method to create a new descriptor matching alljava classesthat are assignable to at least one of the given types.- Parameters:
buildingBlockType- The type of theBuildingBlockthe new descriptor should describe. Must not benull.types- The types the matching java classes should be assignable to. At least one type must be assignable in order to match. Must not benull.- Returns:
- A new descriptor.
-
forAnnotatedWith
static BuildingBlockDescriptor forAnnotatedWith(BuildingBlockType buildingBlockType, Class<? extends Annotation> type)
Convenient method to create a new descriptor matching alljava classesthat are annotated with the given annotation.- Parameters:
buildingBlockType- The type of theBuildingBlockthe new descriptor should describe. Must not benull.type- The annotation with which the matching java classes should be annotated. Must not benull.- Returns:
- A new descriptor.
-
forMetaAnnotatedWith
static BuildingBlockDescriptor forMetaAnnotatedWith(BuildingBlockType buildingBlockType, Class<? extends Annotation> type)
Convenient method to create a new descriptor matching alljava classesthat are meta-annotated with the given annotation. That means the class is either directly annotated with the given annotation or is annotated with an annotation which itself is annotated with the original annotation.- Parameters:
buildingBlockType- The type of theBuildingBlockthe new descriptor should describe. Must not benull.type- The annotation with which the matching java classes should be meta-annotated. Must not benull.- Returns:
- A new descriptor.
-
-