atdParser.setQuirksMode( true );
LdapSyntaxDescriptionSchemaParser lsdParser = new LdapSyntaxDescriptionSchemaParser();
lsdParser.setQuirksMode( true );
MatchingRuleDescriptionSchemaParser mrdParser = new MatchingRuleDescriptionSchemaParser();
mrdParser.setQuirksMode( true );
MatchingRuleUseDescriptionSchemaParser mrudParser = new MatchingRuleUseDescriptionSchemaParser();
mrudParser.setQuirksMode( true );
LdifAttrValLine[] lines = schemaRecord.getAttrVals();
for ( int i = 0; i < lines.length; i++ )
{
LdifAttrValLine line = lines[i];
String attributeName = line.getUnfoldedAttributeDescription();
String value = line.getValueAsString();
List<String> ldifValues = new ArrayList<String>( 1 );
ldifValues.add( value );
try
{
if ( attributeName.equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT ) )
{
ObjectClassDescription ocd = ocdPparser.parseObjectClassDescription( value );
ocd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
addObjectClassDescription( ocd );
}
else if ( attributeName.equalsIgnoreCase( SchemaConstants.ATTRIBUTE_TYPES_AT ) )
{
AttributeTypeDescription atd = atdParser.parseAttributeTypeDescription( value );
atd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
addAttributeTypeDescription( atd );
}
else if ( attributeName.equalsIgnoreCase( SchemaConstants.LDAP_SYNTAXES_AT ) )
{
LdapSyntaxDescription lsd = lsdParser.parseLdapSyntaxDescription( value );
if ( StringUtils.isEmpty( lsd.getDescription() )
&& Utils.getOidDescription( lsd.getNumericOid() ) != null )
{
lsd.setDescription( Utils.getOidDescription( lsd.getNumericOid() ) );
}
lsd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
addLdapSyntaxDescription( lsd );
}
else if ( attributeName.equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT ) )
{
MatchingRuleDescription mrd = mrdParser.parseMatchingRuleDescription( value );
mrd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
addMatchingRuleDescription( mrd );
}
else if ( attributeName.equalsIgnoreCase( SchemaConstants.MATCHING_RULE_USE_AT ) )
{
MatchingRuleUseDescription mrud = mrudParser.parseMatchingRuleUseDescription( value );
mrud.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
addMatchingRuleUseDescription( mrud );
}
else if ( attributeName.equalsIgnoreCase( SchemaConstants.CREATE_TIMESTAMP_AT ) )
{