/* check the fields we catre about */
protected static boolean check( IService service, AST pattern ) {
if (pattern == null) {
return false;
}
IServiceInfo info;
try {
info = service == null ? null : service.getInfo(null);
} catch (IOException e) {
info = null;
CatalogPlugin.log(null, e);
}
boolean t = false;
if (info != null) {
if (info.getTitle() != null)
t = pattern.accept(info.getTitle());
if (!t && info.getKeywords() != null) {
String[] keys = info.getKeywords().toArray(new String[0]);
for( int i = 0; !t && i < keys.length; i++ )
if (keys[i] != null)
t = pattern.accept(keys[i]);
}
if (!t && info.getSchema() != null)
t = pattern.accept(info.getSchema().toString());
if (!t && info.getAbstract() != null)
t = pattern.accept(info.getAbstract());
if (!t && info.getDescription() != null)
t = pattern.accept(info.getDescription());
}
return t;
}