if ( searchString != null )
{
Pattern pattern = Pattern.compile( ".*" + searchString + ".*", Pattern.CASE_INSENSITIVE );
SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();
if ( schemaHandler != null )
{
List<SearchScopeEnum> searchScope = new ArrayList<SearchScopeEnum>( Arrays.asList( scope ) );
// Looping on attribute types
List<AttributeTypeImpl> attributeTypes = schemaHandler.getAttributeTypes();
for ( AttributeTypeImpl at : attributeTypes )
{
// Aliases
if ( searchScope.contains( SearchScopeEnum.ALIASES ) )
{
if ( checkArray( pattern, at.getNames() ) )
{
searchResults.add( at );
continue;
}
}
// OID
if ( searchScope.contains( SearchScopeEnum.OID ) )
{
if ( checkString( pattern, at.getOid() ) )
{
searchResults.add( at );
continue;
}
}
// Description
if ( searchScope.contains( SearchScopeEnum.DESCRIPTION ) )
{
if ( checkString( pattern, at.getDescription() ) )
{
searchResults.add( at );
continue;
}
}
// Superior
if ( searchScope.contains( SearchScopeEnum.SUPERIOR ) )
{
if ( checkString( pattern, at.getSuperiorName() ) )
{
searchResults.add( at );
continue;
}
}
// Syntax
if ( searchScope.contains( SearchScopeEnum.SYNTAX ) )
{
if ( checkString( pattern, at.getSyntaxOid() ) )
{
searchResults.add( at );
continue;
}
}
// Matching Rules
if ( searchScope.contains( SearchScopeEnum.MATCHING_RULES ) )
{
// Equality
if ( checkString( pattern, at.getEqualityName() ) )
{
searchResults.add( at );
continue;
}
// Ordering
if ( checkString( pattern, at.getOrderingName() ) )
{
searchResults.add( at );
continue;
}
// Substring
if ( checkString( pattern, at.getSubstrName() ) )
{
searchResults.add( at );
continue;
}
}
}
// Looping on object classes
List<ObjectClassImpl> objectClasses = schemaHandler.getObjectClasses();
for ( ObjectClassImpl oc : objectClasses )
{
// Aliases
if ( searchScope.contains( SearchScopeEnum.ALIASES ) )
{