private String getNarrowestScope ( FacesContext facesContext , String valueExpression ) { List < String > expressions = extractExpressions ( valueExpression ) ; // exclude NONE scope, if there are more than one ValueExpressions (see Spec for details) String narrowestScope = expressions . size ( ) == 1 ? NONE : APPLICATION ; boolean scopeFound = false ; for ( String expression : expressions ) { String valueScope = getScope ( facesContext , expression ) ; if ( valueScope == null ) { continue ; } // we have found at least one valid scope at this point scopeFound = true ; if ( SCOPE_COMPARATOR . compare ( valueScope , narrowestScope ) < 0 ) { narrowestScope = valueScope ; } } return scopeFound ? narrowestScope : null ; }
Gets the narrowest scope to which the ValueExpression points .