Class ClassImportRule


  • class ClassImportRule
    extends AbstractImportRule
    Represents whether a class is allowed to be imported or not.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String className
      Package to control access to.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassImportRule​(boolean allow, boolean localOnly, java.lang.String className, boolean regExp)
      Constructs an instance.
    • Field Detail

      • className

        private final java.lang.String className
        Package to control access to.
    • Constructor Detail

      • ClassImportRule

        ClassImportRule​(boolean allow,
                        boolean localOnly,
                        java.lang.String className,
                        boolean regExp)
        Constructs an instance.
        Parameters:
        allow - whether to allow access.
        localOnly - whether the rule is to be applied locally only
        className - the class to apply the rule on.
        regExp - whether the class name is to be interpreted as a regular expression.
    • Method Detail

      • verifyImport

        public AccessResult verifyImport​(java.lang.String forImport)
        Verifies whether a class name is used.
        Specified by:
        verifyImport in class AbstractImportRule
        Parameters:
        forImport - the import to check.
        Returns:
        a result AccessResult indicating whether it can be used.