@SuppressWarnings("unchecked")
@Override
public final boolean canProcess( Object context ) {
ServiceExtension2 serviceExtension = getServiceExtension();
if( context instanceof ID){
ID id=(ID) context;
return canProcess(serviceExtension, id);
}
if( context instanceof URL){
URL url=(URL) context;
return canProcess(serviceExtension, url);
}
if( context instanceof String){
// if the string cannot be processed we want to fall through so
// that doOtherChecks() can be called.
String string=(String) context;
try{
URL url=new URL(string);
if ( canProcess(serviceExtension, url) )
return true;
}catch (MalformedURLException e) {
// continue.
}
}
if( context instanceof Map){
Map map=(Map) context;
return canProcess(serviceExtension, map);
}
if( context instanceof IResolve){
ID id = ((IResolve)context).getID();
return canProcess(serviceExtension, id);
}
if( CatalogPlugin.locateURL(context)!=null ){
return canProcess(serviceExtension, CatalogPlugin.locateURL(context));
}