@Override
  public void readExternal(Element element) {
    super.readExternal(element);

    regExp = StringUtil.notNullize(element.getAttributeValue(REGEXP));
    withinHierarchy = getBooleanValue(element, WITHIN_HIERARCHY, false);
    invertRegExp = getBooleanValue(element, NEGATE_NAME_CONDITION, false);
    wholeWordsOnly = getBooleanValue(element, WHOLE_WORDS_ONLY, false);

    nameOfExprType = StringUtil.notNullize(element.getAttributeValue(NAME_OF_EXPRTYPE));
    expressionTypes = convertRegExpTypeToTypeString(nameOfExprType);

    exprTypeWithinHierarchy = getBooleanValue(element, EXPRTYPE_WITHIN_HIERARCHY, false);
    invertExprType = getBooleanValue(element, NEGATE_EXPRTYPE_CONDITION, false);

    nameOfFormalArgType = StringUtil.notNullize(element.getAttributeValue(NAME_OF_FORMALTYPE));
    expectedTypes = convertRegExpTypeToTypeString(nameOfFormalArgType);

    formalArgTypeWithinHierarchy = getBooleanValue(element, FORMALTYPE_WITHIN_HIERARCHY, false);
    invertFormalType = getBooleanValue(element, NEGATE_FORMALTYPE_CONDITION, false);

    minCount = getIntValue(element, MIN_OCCURS, 1);
    maxCount = getIntValue(element, MAX_OCCURS, 1);

    referenceConstraint = StringUtil.notNullize(element.getAttributeValue(REFERENCE_CONDITION));
    invertReference = getBooleanValue(element, NEGATE_REFERENCE_CONDITION, false);

    containsConstraint = StringUtil.notNullize(element.getAttributeValue(CONTAINS_CONDITION));
    invertContainsConstraint = getBooleanValue(element, NEGATE_CONTAINS_CONDITION, false);

    withinConstraint = StringUtil.notNullize(element.getAttributeValue(WITHIN_CONDITION));
    invertWithinConstraint = getBooleanValue(element, NEGATE_WITHIN_CONDITION, false);

    partOfSearchResults = getBooleanValue(element, TARGET, false);

    contextConstraint = StringUtil.notNullize(element.getAttributeValue(CONTEXT));

    for (Attribute attribute : element.getAttributes()) {
      final String mangledName = attribute.getName();
      if (!StringUtil.startsWith(mangledName, "_")) {
        continue;
      }
      final String name = mangledName.substring(1);
      if (!isValidConstraintName(name)) {
        throw new InvalidDataException();
      }
      if (additionalConstraints == null) {
        additionalConstraints = new HashMap<>();
      }
      additionalConstraints.put(name, attribute.getValue());
    }
  }
@Override
  public void readExternal(Element element)