@Override
  public void readExternal(Element element) {
    pattern = StringUtil.notNullize(element.getAttributeValue(TEXT_ATTRIBUTE_NAME));

    looseMatching = MatchVariableConstraint.getBooleanValue(element, LOOSE_MATCHING_ATTRIBUTE_NAME, true);

    recursiveSearch = MatchVariableConstraint.getBooleanValue(element, RECURSIVE_ATTRIBUTE_NAME, false);

    // complicated for backwards compatibility
    caseSensitiveMatch = MatchVariableConstraint.getBooleanValue(element, OLD_CASE_SENSITIVE_ATTRIBUTE_NAME, false) ||
                         MatchVariableConstraint.getBooleanValue(element, CASE_SENSITIVE_ATTRIBUTE_NAME, false);

    myUnknownFileType = element.getAttributeValue(FILE_TYPE_ATTR_NAME);
    myFileType = (myUnknownFileType == null) ? null : StructuralSearchUtil.getSuitableFileTypeByName(myUnknownFileType);
    if (myFileType != null) {
      myUnknownFileType = null;
    }
    myDialect = Language.findLanguageByID(element.getAttributeValue(DIALECT_ATTR_NAME));
    myPatternContextId = element.getAttributeValue(PATTERN_CONTEXT_ATTR_NAME);

    final String value = element.getAttributeValue(SCOPE_TYPE);
    scopeType = (value == null) ? null : Scopes.Type.valueOf(value);
    scopeDescriptor = element.getAttributeValue(SCOPE_DESCRIPTOR);
    searchInjectedCode = MatchVariableConstraint.getBooleanValue(element, SEARCH_INJECTED_CODE, true);

    for (final Element element1 : element.getChildren(CONSTRAINT_TAG_NAME)) {
      final MatchVariableConstraint constraint = new MatchVariableConstraint();
      constraint.readExternal(element1);
      addVariableConstraint(constraint);
    }
  }
@Override
  public void readExternal(Element element)