Class ArchConfiguration


  • public final class ArchConfiguration
    extends java.lang.Object
    Allows access to configured properties in "archunit.properties".
    • Method Detail

      • resolveMissingDependenciesFromClassPath

        @PublicAPI(usage=ACCESS)
        public boolean resolveMissingDependenciesFromClassPath()
      • setResolveMissingDependenciesFromClassPath

        @PublicAPI(usage=ACCESS)
        public void setResolveMissingDependenciesFromClassPath​(boolean newValue)
      • setMd5InClassSourcesEnabled

        @PublicAPI(usage=ACCESS)
        public void setMd5InClassSourcesEnabled​(boolean enabled)
      • getClassResolverArguments

        @PublicAPI(usage=ACCESS)
        public java.util.List<java.lang.String> getClassResolverArguments()
      • setClassResolverArguments

        @PublicAPI(usage=ACCESS)
        public void setClassResolverArguments​(java.lang.String... args)
      • setExtensionProperties

        @PublicAPI(usage=ACCESS)
        public void setExtensionProperties​(java.lang.String extensionIdentifier,
                                           java.util.Properties properties)
      • getExtensionProperties

        @PublicAPI(usage=ACCESS)
        public java.util.Properties getExtensionProperties​(java.lang.String extensionIdentifier)
      • getSubProperties

        @PublicAPI(usage=ACCESS)
        public java.util.Properties getSubProperties​(java.lang.String propertyPrefix)
        Returns a set of properties where all keys share a common prefix. The prefix is removed from those property names. Example:
        
         some.custom.prop1=value1
         some.custom.prop2=value2
         unrelated=irrelevant
        Then getSubProperties("some.custom") would return the properties
        
         prop1=value1
         prop2=value2
        Parameters:
        propertyPrefix - A prefix for a set of properties
        Returns:
        All properties with this prefix, where the prefix is removed from the keys.
      • getProperty

        @PublicAPI(usage=ACCESS)
        public java.lang.String getProperty​(java.lang.String propertyName)
        Parameters:
        propertyName - Full name of a property
        Returns:
        A property of the global ArchUnit configuration. This method will throw an exception if the property is not set within the configuration.
        See Also:
        containsProperty(String), setProperty(String, String)
      • setProperty

        @PublicAPI(usage=ACCESS)
        public void setProperty​(java.lang.String propertyName,
                                java.lang.String value)
        Overwrites a property of the global ArchUnit configuration. Note that this change will persist for the whole life time of this JVM unless overwritten another time.
        Parameters:
        propertyName - Full name of a property
        value - The new value to set. Overwrites any existing property with the same name.
        See Also:
        containsProperty(String), getProperty(String)