/// <summary> Validates a basic condition against the white list pattern and the /// blacklist pattern /// /// </summary> /// <param name="condition">the object representation of the condition /// </param> /// <param name="pattern">the positive pattern of valid conditions /// </param> /// <param name="exclusionPattern">the negative pattern of excluded conditions /// </param> /// <param name="results">the <code>CleanResults</code> object to add any error /// messages to /// </param> /// <returns> true if this selector name is valid; false otherwise /// </returns> private bool validateCondition(AttributeCondition condition, string pattern, string exclusionPattern, CleanResults results) { // check that the name of the condition matches valid pattern and does // not match exclusion pattern // NOTE: intentionally using non-short-circuited AND operator to // generate all relevant error messages //return pattern.Pattern.matcher(condition.toString().toLowerCase()).matches() & !exclusionPattern.Pattern.matcher(condition.toString().toLowerCase()).matches(); return(true); }
/// <summary> Validates a basic condition against the white list pattern and the /// blacklist pattern /// /// </summary> /// <param name="condition">the object representation of the condition /// </param> /// <param name="pattern">the positive pattern of valid conditions /// </param> /// <param name="exclusionPattern">the negative pattern of excluded conditions /// </param> /// <param name="results">the <code>CleanResults</code> object to add any error /// messages to /// </param> /// <returns> true if this selector name is valid; false otherwise /// </returns> private bool validateCondition(AttributeCondition condition, string pattern, string exclusionPattern, CleanResults results) { // check that the name of the condition matches valid pattern and does // not match exclusion pattern // NOTE: intentionally using non-short-circuited AND operator to // generate all relevant error messages //return pattern.Pattern.matcher(condition.toString().toLowerCase()).matches() & !exclusionPattern.Pattern.matcher(condition.toString().toLowerCase()).matches(); return true; }