String computedSearchString = searchString.replaceAll( "\\*", "\\\\S*" );
computedSearchString = computedSearchString.replaceAll( "\\?", ".*" );
Pattern pattern = Pattern.compile( computedSearchString, Pattern.CASE_INSENSITIVE );
SchemaHandler schemaHandler = Activator.getDefault().getSchemaHandler();
if ( schemaHandler != null )
{
List<SearchInEnum> searchScope = new ArrayList<SearchInEnum>( Arrays.asList( searchIn ) );
if ( ( scope == PluginConstants.PREFS_SEARCH_PAGE_SCOPE_AT_AND_OC )
|| ( scope == PluginConstants.PREFS_SEARCH_PAGE_SCOPE_AT_ONLY ) )
{
// Looping on attribute types
List<AttributeTypeImpl> attributeTypes = schemaHandler.getAttributeTypes();
for ( AttributeTypeImpl at : attributeTypes )
{
// Aliases
if ( searchScope.contains( SearchInEnum.ALIASES ) )
{
if ( checkArray( pattern, at.getNamesRef() ) )
{
searchResults.add( at );
continue;
}
}
// OID
if ( searchScope.contains( SearchInEnum.OID ) )
{
if ( checkString( pattern, at.getOid() ) )
{
searchResults.add( at );
continue;
}
}
// Description
if ( searchScope.contains( SearchInEnum.DESCRIPTION ) )
{
if ( checkString( pattern, at.getDescription() ) )
{
searchResults.add( at );
continue;
}
}
// Superior
if ( searchScope.contains( SearchInEnum.SUPERIOR ) )
{
if ( checkString( pattern, at.getSuperiorName() ) )
{
searchResults.add( at );
continue;
}
}
// Syntax
if ( searchScope.contains( SearchInEnum.SYNTAX ) )
{
if ( checkString( pattern, at.getSyntaxOid() ) )
{
searchResults.add( at );
continue;
}
}
// Matching Rules
if ( searchScope.contains( SearchInEnum.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;
}
}
}
}
if ( ( scope == PluginConstants.PREFS_SEARCH_PAGE_SCOPE_AT_AND_OC )
|| ( scope == PluginConstants.PREFS_SEARCH_PAGE_SCOPE_OC_ONLY ) )
{
// Looping on object classes
List<ObjectClassImpl> objectClasses = schemaHandler.getObjectClasses();
for ( ObjectClassImpl oc : objectClasses )
{
// Aliases
if ( searchScope.contains( SearchInEnum.ALIASES ) )
{