public boolean isValid ( ) { // Must be non-empty... boolean valid = varNamePath_ != null ; if ( valid ) { // Containing a sequence of identifiers... int i ; for ( i = 0 ; i < varNamePath_ . length && DefUtils . isIdentifier ( varNamePath_ [ i ] ) ; i ++ ) ; // Optionally terminated by a single wildcard. int membersLeft = varNamePath_ . length - i ; valid = membersLeft == 0 || ( membersLeft == 1 && ( varNamePath_ [ i ] . equals ( ALL_DESCENDANTS ) || varNamePath_ [ i ] . equals ( ALL_CHILDREN ) ) ) ; } return valid ; }
Returns true if this pattern is valid .