MatchingRuleUse extends AbstractNamedSchemaElement { public static MatchingRuleUse parse(final String definition) throws ParseException { final Matcher m = DEFINITION_PATTERN.matcher(definition); if (!m.matches()) { throw new ParseException("Invalid matching rule use definition: " + definition, definition.length()); } final MatchingRuleUse mrud = new MatchingRuleUse(m.group(1).trim()); if (m.group(2) != null) { mrud.setNames(SchemaUtils.parseDescriptors(m.group(2).trim())); } else if (m.group(3) != null) { mrud.setNames(SchemaUtils.parseDescriptors(m.group(3).trim())); } mrud.setDescription(m.group(4) != null ? m.group(4).trim() : null); mrud.setObsolete(m.group(5) != null); if (m.group(6) != null) { mrud.setAppliesAttributeTypes(SchemaUtils.parseOIDs(m.group(6).trim())); } else if (m.group(7) != null) { mrud.setAppliesAttributeTypes(SchemaUtils.parseOIDs(m.group(7).trim())); } if (m.group(8) != null) { mrud.setExtensions(Extensions.parse(m.group(8).trim())); } return mrud; } MatchingRuleUse(final String s);  MatchingRuleUse(
    final String oid,
    final String[] names,
    final String description,
    final boolean obsolete,
    final String[] appliesAttributeTypes,
    final Extensions extensions); String getOID(); String[] getAppliesAttributeTypes(); void setAppliesAttributeTypes(final String[] s); static MatchingRuleUse parse(final String definition); @Override String format(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test(groups = "schema", dataProvider = "definitions") public void parse(final MatchingRuleUse matchingRule, final String definition) throws Exception { final MatchingRuleUse parsed = MatchingRuleUse.parse(definition); Assert.assertEquals(matchingRule, parsed); Assert.assertEquals(definition, parsed.format()); Assert.assertEquals(matchingRule.format(), parsed.format()); }