@ SuppressWarnings ( "checkstyle:BooleanExpressionComplexity" ) private boolean isHidden ( final ContextTreeConfig config , final ItemInfo info , final Class < ? > scope ) { // item explicitly hidden final boolean hidden = config . getHiddenItems ( ) . contains ( info . getItemType ( ) ) ; // installer disabled final boolean disabled = config . isHideDisables ( ) && isDisabled ( info ) ; // duplicate registration final boolean ignored = config . isHideDuplicateRegistrations ( ) && isDuplicateRegistration ( info , scope ) ; // item in scope hidden by config (special case for bundle: when its hidden by config) final boolean hiddenScope = ! isScopeVisible ( config , null , scope ) || isHiddenBundle ( config , info ) ; // installer without any extension final boolean notUsedInstaller = config . isHideNotUsedInstallers ( ) && isNotUsedInstaller ( info ) ; return hidden || disabled || ignored || hiddenScope || notUsedInstaller ; }
Checks element visibility according to config . Universal place to check visibility for either simple config items or bundles and special scopes .